ubuntu18.04使用root登录

一、root不需要认证在,直接登陆

1、在终端中切换到root用户 ,初始密码设置 ,sudo passwd

2、安装 lightdm ,apt install lightdm 在 gdm3和lightdm 中选择lightdm

3、sudo vim /usr/share/lightdm/lightdm.conf.d/50-unity-greeter.conf

将该文件修改为

[Seat:*]
greeter-session=unity-greeter
user-session=ubuntu
greeter-show-manual-login=true
autologin-user=root
autologin-guest=false

4、vim /root/.profile 

将文件末尾mesg n || true修改为tty -s&&mesg n || true

参考博客https://blog.csdn.net/li13888557180/article/details/80203439

https://blog.csdn.net/xiongchun11/article/details/80606106

二、root 登录需要认证

参考

https://blog.csdn.net/qq_39591507/article/details/81288644

 

你可能感兴趣的:(ubuntu18.04使用root登录)