ubuntu 20.04 open root account

After ubuntu 20.04 is installed by default, the root account is not opened, so you need to open it yourself, record it:

1. Set the root password:

    sudo passwd root

2. Use the root user in the account:
    su root


3. Configure:
sudo gedit /etc/pam.d/gdm-autologin
#auth required pam_succeed_if.so user != root quiet_success

sudo gedit /etc/pam.d/gdm-password
#auth    required    pam_succeed_if.so user != root quiet_success

4. After logging out, use the root account to log in to
Ubuntu. After enabling the root account, an error is reported when logging in to the root account: An error was found when reading /root/.profile: mesg: ttyname failed: As a result of an inappropriate ioctl operation on the device, the session will not be blocked. correctly configured

gedit /root/.profile
change mesg n || true to tty -s && mesg n || true

Guess you like

Origin blog.csdn.net/aizsa111/article/details/129379292