After Ubuntu has just been installed, running the SU command in terminal will require a password, however, no matter what the loss will be wrong, the direct return is also wrong, because Root does not have a default password, need to manually set.
To install the user name entered in Ubuntu login, the user in the Admin group, has the authority to set the root password.
To set a password for the root user, specify the following steps:
1. Open a terminal and enter the following command
sudo passwd [root] or sudo passwd
Enter the original password, the new password and the confirmation password,
[sudo] password for you:-> enter your password (you are now the user's password), will not display your password in the interface, you can remember how much the password entered
Enter new UNIX password:-> to set the root password
Retype new UNIX password:–> Repeat this
This way your root password is set.
Note: Root can be omitted, command is passwd instead of password, I have made this mistake.
You can switch to the root user by using the SU command in the terminal.
Note: The difference between Su and sudo is:
1, Su's password is the root password, and sudo password is the user's password;
2, Su directly to the identity to root, and sudo is the user log in as root to run the command, do not need to know the root password, in other words, the SU command after all commands are root, and sudo only the current statement is the root identity execution.
Solve the problem of the SU command password error when Ubuntu just installed