ubuntu switch root prompts "Authentication failure"

To run administrative tasks in Linux, you must have root (also known as super user) access. In most Linux distributions, it is common to have a separate root account, but Ubuntu disables the root account by default. This prevents user errors and prevents the system from being attacked by intruders. To run commands that require root access, use sudo.

Switch to root user

How to switch ubuntu to the root user, we all know that using the su root command to switch to root privileges, you will be prompted to enter the password at this time, but no matter how you enter it, it prompts "Authentication failure".

There are two situations at this time:

1) One is that the password is really wrong,

2) The other is the newly installed Linux system without a password for root.

  1. Press ctrl+alt+T to open a terminal window. Enter the command: su root, press Enter to prompt for a password, but the input is wrong
  2. Set a password for the root user:

    Command: sudo passwd root

    Enter the password and confirm the password.

  3. Re-enter the command: su root

    Then enter the password:

    Found that you can switch to root privileges.

  4. Use  su username command, switch to the ordinary user.

 

 

 

Reference: http://www.mamicode.com/info-detail-2922390.html

Guess you like

Origin blog.csdn.net/MasterCayman/article/details/109804374