ubuntu默认账户密码_ubuntu初次启动密码

后端 (6) 2024-03-23 15:23

Hi,大家好,我是编程小6,很荣幸遇见你,我把这些年在开发过程中遇到的问题或想法写出来,今天说一说ubuntu默认账户密码_ubuntu初次启动密码,希望能够帮助你!!!。
Ubuntu20.04开启root账户的方法

1 创建root账户密码

以普通用户登录系统,创建root用户的密码,在终端输入命令:sudo passwd root

根据提示输入设置的密码,完成root用户密码设置。

ubuntu默认账户密码_ubuntu初次启动密码_https://bianchenghao6.com/blog_后端_第2张

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

ubuntu默认账户密码_ubuntu初次启动密码_https://bianchenghao6.com/blog_后端_第4张

3 修改/etc/pam.d/gdm-autologin文件配置

sudo vim /etc/pam.d/gdm-autologin

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

ubuntu默认账户密码_ubuntu初次启动密码_https://bianchenghao6.com/blog_后端_第6张

4 修改/etc/pam.d/gdm-password文件配置

sudo vim /etc/pam.d/gdm-password

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

ubuntu默认账户密码_ubuntu初次启动密码_https://bianchenghao6.com/blog_后端_第8张

5 修改 /root/.profile文件配置

sudo vim /root/.profile

将文件末尾的 mesg n 2> /dev/null || true 这一行修改成

tty -s&&mesg n || true

ubuntu默认账户密码_ubuntu初次启动密码_https://bianchenghao6.com/blog_后端_第10张

7 注销重新登录系统

在登录界面选择Not listed? ,输入root账户和密码,即可登录成功。

ubuntu默认账户密码_ubuntu初次启动密码_https://bianchenghao6.com/blog_后端_第12张

今天的分享到此就结束了,感谢您的阅读,如果确实帮到您,您可以动动手指转发给其他人。