How do you sign Ubuntu graphical interface using the root user?
There are two reasons I think experiencing this problem:
1, the newly installed Ubuntu does not set the root password
2, the configuration is not provided pam authentication
Solve the first problem:
lokott@lokott:~$ sudo passwd root
[sudo] lokott 的密码:
输入新的 UNIX 密码:
重新输入新的 UNIX 密码:
passwd:已成功更新密码
After previous problems solved or can not log:
Solve the second problem:
lokott@lokott:~$ cd /etc/pam.d/
lokott@lokott:/etc/pam.d$ ls
chfn common-auth cron gdm-launch-environment other runuser sudo
chpasswd common-password cups gdm-password passwd runuser-l systemd-user
chsh common-session gdm-autologin login polkit-1 sshd vmtoolsd
common-account common-session-noninteractive gdm-fingerprint newusers ppp su
lokott@lokott:/etc/pam.d$ sudo -i #切换root用户
root@lokott:~#
#修改两个文件的配置:gdm-autologin gdm-password其实就是加个注释
root@lokott:~# cd /etc/pam.d/
root@lokott:/etc/pam.d# vim gdm-autologin
root@lokott:/etc/pam.d# vim gdm-password
As shown below:
Modify /root/.profile file (root user environment variables file), restart the system using the root login
Here to explain the meaning of the shell statement it:
tty -s&&mesg n || true
This statement relates to shell commands understood and appreciated that the combinational logic determination
First tty -s means: do not display any information, only the return status code.
mesg n said: do not allow other users to information displayed directly on your screen.
true do not say it, is true
tty -s && mesg n the composition is true, the back is not performed, is performed for the false true
Then login authentication: