当我启动计算机时,它直接进入命令行。我将/etc/default/grub
文件从修改GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
为quiet splash text
。
有人能解释一下如何在启动命令行时设置自动登录吗?我发现sudo visudo
这会完全删除 sudo 密码,但这不是我想要的。
设置自动登录/etc/lightdm/lightdm.conf
仅为 GUI 自动登录。
先感谢您。
答案1
为了自动登录 Ubuntu,您可以修改以下文件/etc/init/tty1.conf
:
# tty1 - getty
#
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.
start on stopped rc RUNLEVEL=[2345] and (
not-container or
container CONTAINER=lxc or
container CONTAINER=lxc-libvirt)
stop on runlevel [!2345]
respawn
exec /sbin/getty -n -l /bin/su -o '- root' -8 38400 tty1
如果您想了解该脚本的含义,请参阅man init
。
这将以 root 身份登录!替换'- root'
为您要以'- user'
哪个user
用户身份登录