Linux Centos 自动登录
图形界面自动登录
1. 打开/etc/gdm/custom.conf
vi /etc/gdm/custom.conf
2.在文件[daemon]下写入
AutomaticLoginEnable=True AutomaticLogin=root
3.重启
在终端输入reboot重启电脑,完成设置
命令行自动登录
1. 备份 /lib/systemd/system/getty@.services
cp /lib/systemd/system/getty@.service /lib/systemd/system/getty@.service_bak
2. /lib/systemd/system/getty@.services中的ExecStart内容项备份并修改成:
#ExecStart=-/sbin/agetty -o '-p -- \\u' --noclear - $TERM ExecStart=-/sbin/agetty --noclear - $TERM --autologin root

浙公网安备 33010602011771号