Linux系统设置默认用户为root并自动登录

1 打开配置文件

/etc/gdm/custom.conf

2 修改配置文件

# 即在[daemon]处的下方写入如下的内容即可
AutomaticLoginEnable=True
AutomaticLogin=root

3 重启centos

# 在终端执行如下命令,也可以在图形界面中点击重启
reboot