Debian12 如何使用root用户登陆系统 ssh登入及桌面登入

技术文章10个月前发布 gyx131
87 0 0

新装 Debian12 系统,默认无法使用 root 用户登陆。

解决方案一实现桌面 root 用户登陆

su root

输入root用户密码

vim /etc/gdm3/daemon.conf 
Debian12 如何使用root用户登陆系统  ssh登入及桌面登入

在security下面加上这么一行:AllowRoot = true

<Esc>:wq 保存退出

vim /etc/pam.d/gdm-password
Debian12 如何使用root用户登陆系统  ssh登入及桌面登入

用#注释掉 auth required pam_succeed_if.so user != root quiet_success 这一行

<Esc>:wq 保存退出

sudo reboot

重启系统,就可以用 root 用户登录桌面了

解决方案二实现 ssh 远程 root 用户登陆

vim /etc/ssh/sshd_config
Debian12 如何使用root用户登陆系统  ssh登入及桌面登入

1,找到#PermitRootLogin一行 改成PermitRootLogin yes,也就是删掉前端的注释并做改后面的值为yes,2

2,删掉#PasswordAuthentication yes前面的#

<Esc>:wq 保存退出

sudo service ssh restart

重启 ssh 服务,就可以用 root 用户远程 ssh 登录了

© 版权声明

相关文章

暂无评论

暂无评论...