Ubuntu16.04设置root以及root用户自动登录

1.首先设置root用户密码:

# sudo passwd root

输入普通用户密码,再输入root用户密码;

2.启用登录时的root选项:

编辑50-ubuntu.conf文件:

# sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

添加:

greeter-show-manual-login=true

编辑/root/.profile文件:

# sudo gedit /root/.profile

找到 mesg n这一行,修改为:

tty -s && mesg n

保存退出~

3.配置root自动登陆:

编辑lightdm.conf文件:

# sudo gedit  /etc/lightdm/lightdm.conf

添加如下内容:

[SeatDefaults]
autologin-user=root
greeter-session=unity-greeter
user-session=ubuntu
greeter-show-manual-login=true
allow-guest=false

保存重启完事~

你可能感兴趣的:(ubuntu)