Ubuntu 16.04(cat /etc/issue或者sudo lsb_release -a)默认是不允许root登录的,在登录窗口只能看到普通用户和访客登录。以普通身份登陆Ubuntu后我们需要做一些修改,普通用户登录后,修改系统配置文件需要切换到超级用户模式,在终端窗口里面输入: sudo -s.然后输入普通用户登陆的密码,回车即可进入 root用户权限模式。
然后执行:gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
作如下修改:
第三行:要求用户手工输入登陆系统的用户名和密码
第四行:不允许guest用户登录
然后执行:sudo passwd root 设置root密码。
重启后以root登录,一般斗湖出现如下错误:
Error found when loading /root/.profile:
stdin:is not a tty
As result the session will not be configured correctly.
You should fix the problem as soon as feasible.
执行 gedit /root/.profile 作如下修改:
至此,我们就可以使用root用户登录。