Ubuntu20.04开启root账户的方法
1 创建root账户密码
以普通用户登录系统,创建root用户的密码,在终端输入命令:sudo passwd root
根据提示输入设置的密码,完成root用户密码设置。
2 修改/usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf文件配置
sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
在文件末尾添加如下两行:
greeter-show-manual-login=true
all-guest=false




3 修改/etc/pam.d/gdm-autologin文件配置
sudo vim /etc/pam.d/gdm-autologin
注释掉第三行:auth required pam_succeed_if.so user != root quiet_success




4 修改/etc/pam.d/gdm-password文件配置
sudo vim /etc/pam.d/gdm-password
注释掉第三行:auth required pam_succeed_if.so user != root quiet_success




5 修改 /root/.profile文件配置
sudo vim /root/.profile
将文件末尾的 mesg n 2> /dev/null || true 这一行修改成
tty -s&&mesg n || true




7 注销重新登录系统
在登录界面选择Not listed? ,输入root账户和密码,即可登录成功。




2024最新激活全家桶教程,稳定运行到2099年,请移步至置顶文章:https://sigusoft.com/99576.html
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。 文章由激活谷谷主-小谷整理,转载请注明出处:https://sigusoft.com/14323.html