ubuntu修改默认root账号登陆

安装完成如需使用root身份登录,可打开终端输入以下命令:
#设置root密码
sudo passwd root
#切换到root用户
sudo -s

想要在登录界面使用root身份登录,可编辑/etc/lightdm/目录下的lightdm.conf文件,如没有此文件,直接创建

vi /etc/lightdm/lightdm.conf

文件内容最终为:
[SeatDefaults]
#启动后以root身份自动登录,如果要求输入密码登陆,可以注释下面这一行即可
autologin-user=root
greeter-session=unity-greeter
user-session=ubuntu
#手工输入登陆系统的用户名和密码
greeter-show-manual-login=true
#禁用guest用户
allow-guest=false

重启后提示 在刚修改完root权限自动登录后,发现开机出现以下提示:

Error found when loading /root/.profile

stdin:is not a tty

…………

解决方法:在终端中用命令gedit /root/.profile,打开文件后找到“mesg n”,

将其更改为“tty -s && mesg n



原文地址:https://www.cnblogs.com/flyDream12315/p/4646982.html