使用的是CentOS 6.5环境
先修改 /etc/init/tty.conf文件
exec /sbin/mingetty
--autologin root $TTY
红色为增加内容
修改[daemon]选项
AutomaticLoginEnable=true
AutomaticLogin=root
TimedLoginEnable=true
修改[security]
AllowRoot=true
下面是修改之后,重启后的文件
[root@localhost etc]# vi /etc/gdm/custom.conf
# GDM configuration storage
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=root
TimedLoginEnable=true
TimedLogin=root
TimedLoginDelay=7
[security]
AllowRoot=true
[xdmcp]
[greeter]
[chooser]
[debug]
这种方法不是每次都成功,有的root用户不行,换成其他用户就可以。只是做一下参考