CentOS7 不带图形界面 自动登录配置
转自https://www.centos.org/forums/viewtopic.php?t=48288
网上找的大部分都是修改gdm,或者是centos6版本开机的配置文件修改,但是centos7启动配置方式做了改变,网上方法都不可用了。
http://forums.fedoraforum.org/showthread.php?t=297228
1. remove the original getty@tty1.service symlink:
rm /etc/systemd/system/getty.target.wants/getty@tty1.service
2. make a copy of the getty@.service file and call it getty@tty1.service
cp /lib/systemd/system/getty@.service /etc/systemd/system/getty@tty1.service
3. edit this file (the last line, must be ADDED):
[Service]
...
ExecStart=-/sbin/agetty --autologin root --noclear %I
...
[Install]
...
;Alias=getty@tty1.service
4. make a symlink in getty.target.wants
ln -s /etc/systemd/system/getty@tty1.service /etc/systemd/system/getty.target.wants/getty@tty1.service
5. Reboot. It everything went fine you will be logged in as root.