用xshell
使用root账户进入系统后,打开’/etc/gdm/custom.conf’文件,在[daemon]下添加两行:
AutomaticLoginEnable=True
AutomaticLogin=root
效果如下
ast login: Sun Jun 6 11:37:56 2021
[root@localhost ~]# cat /etc/shadow
root:$6$y5aH9q072y69.84h$Nm9Vux9u9u6XWZl02EHJ0O2XpEUQKdOFosAIRDCu2SXSU1TBJ81nFAgPzkLsPxLr8hqZI2/4RhmdSVr2HtrqT1::0:99999:7:::
bin:*:18353:0:99999:7:::
daemon:*:18353:0:99999:7:::
adm:*:18353:0:99999:7:::
lp:*:18353:0:99999:7:::
sync:*:18353:0:99999:7:::
shutdown:*:18353:0:99999:7:::
halt:*:18353:0:99999:7:::
mail:*:18353:0:99999:7:::
operator:*:18353:0:99999:7:::
games:*:18353:0:99999:7:::
ftp:*:18353:0:99999:7:::
nobody:*:18353:0:99999:7:::
systemd-network:!!:18783::::::
dbus:!!:18783::::::
polkitd:!!:18783::::::
libstoragemgmt:!!:18783::::::
colord:!!:18783::::::
rpc:!!:18783:0:99999:7:::
saned:!!:18783::::::
gluster:!!:18783::::::
saslauth:!!:18783::::::
abrt:!!:18783::::::
rtkit:!!:18783::::::
pulse:!!:18783::::::
radvd:!!:18783::::::
chrony:!!:18783::::::
qemu:!!:18783::::::
ntp:!!:18783::::::
unbound:!!:18783::::::
tss:!!:18783::::::
sssd:!!:18783::::::
usbmuxd:!!:18783::::::
geoclue:!!:18783::::::
setroubleshoot:!!:18783::::::
gdm:!!:18783::::::
rpcuser:!!:18783::::::
nfsnobody:!!:18783::::::
gnome-initial-setup:!!:18783::::::
sshd:!!:18783::::::
avahi:!!:18783::::::
postfix:!!:18783::::::
tcpdump:!!:18783::::::
admin:$6$K6k000kyUZ20QF9.$urr8f4aN2U/pgNAOuO6uiqqDca6HDuPzfFEskhquJLJZh9X9mxvIyKqo1fyUOHMkGyZ3aeDl7pt5J/yhIQvXO0:18784:0:99999:7:::
[root@localhost ~]# userdel admin
[root@localhost ~]# cat /etc/shadow
root:$6$y5aH9q072y69.84h$Nm9Vux9u9u6XWZl02EHJ0O2XpEUQKdOFosAIRDCu2SXSU1TBJ81nFAgPzkLsPxLr8hqZI2/4RhmdSVr2HtrqT1::0:99999:7:::
bin:*:18353:0:99999:7:::
daemon:*:18353:0:99999:7:::
adm:*:18353:0:99999:7:::
lp:*:18353:0:99999:7:::
sync:*:18353:0:99999:7:::
shutdown:*:18353:0:99999:7:::
halt:*:18353:0:99999:7:::
mail:*:18353:0:99999:7:::
operator:*:18353:0:99999:7:::
games:*:18353:0:99999:7:::
ftp:*:18353:0:99999:7:::
nobody:*:18353:0:99999:7:::
systemd-network:!!:18783::::::
dbus:!!:18783::::::
polkitd:!!:18783::::::
libstoragemgmt:!!:18783::::::
colord:!!:18783::::::
rpc:!!:18783:0:99999:7:::
saned:!!:18783::::::
gluster:!!:18783::::::
saslauth:!!:18783::::::
abrt:!!:18783::::::
rtkit:!!:18783::::::
pulse:!!:18783::::::
radvd:!!:18783::::::
chrony:!!:18783::::::
qemu:!!:18783::::::
ntp:!!:18783::::::
unbound:!!:18783::::::
tss:!!:18783::::::
sssd:!!:18783::::::
usbmuxd:!!:18783::::::
geoclue:!!:18783::::::
setroubleshoot:!!:18783::::::
gdm:!!:18783::::::
rpcuser:!!:18783::::::
nfsnobody:!!:18783::::::
gnome-initial-setup:!!:18783::::::
sshd:!!:18783::::::
avahi:!!:18783::::::
postfix:!!:18783::::::
tcpdump:!!:18783::::::
[root@localhost ~]# Connection closing...Socket close.
Connection closed by foreign host.
Disconnected from remote host(192.168.186.128) at 11:39:45.
重启即可