新装 Debian12 系统,默认无法使用 root 用户登陆。
解决方案一实现桌面 root 用户登陆
su root
输入root用户密码
vim /etc/gdm3/daemon.conf

在security下面加上这么一行:AllowRoot = true
<Esc>:wq 保存退出
vim /etc/pam.d/gdm-password

用#注释掉 auth required pam_succeed_if.so user != root quiet_success 这一行
<Esc>:wq 保存退出
sudo reboot
重启系统,就可以用 root 用户登录桌面了
解决方案二实现 ssh 远程 root 用户登陆
vim /etc/ssh/sshd_config

1,找到#PermitRootLogin
一行 改成PermitRootLogin yes
,也就是删掉前端的注释并做改后面的值为yes,2
2,删掉
#PasswordAuthentication yes
前面的#
<Esc>:wq 保存退出
sudo service ssh restart
重启 ssh 服务,就可以用 root 用户远程 ssh 登录了
© 版权声明
文章版权归作者所有,未经允许请勿转载。
相关文章
暂无评论...