先以其他用户(demo)登入系统,打开命令行

demo@debian:~$ su - root	##切换root登录
Password: 
root@debian:~# 

修改配置文件

/etc/gdm3/daemon.conf

root@debian:~# vim /etc/gdm3/daemon.conf ##在[security]下添加
[security]
AllowRoot=true

/etc/pam.d/gdm-password

root@debian:~# vim /etc/pam.d/gdm-password

#auth   required        pam_succeed_if.so user != root quiet_success			###注释掉第三行