CentOS Minimal 版本可通过修改系统服务配置实现自动登录,以下是具体步骤(以图形界面为例):
vi
)打开 /etc/gdm/custom.conf
:sudo vi /etc/gdm/custom.conf
[daemon]
部分添加以下内容(替换 <用户名>
为实际用户名):AutomaticLoginEnable=True
AutomaticLogin=<用户名>
示例(以 root
用户为例):AutomaticLoginEnable=True
AutomaticLogin=root
sudo reboot
说明:
getty
服务配置(参考)。