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]
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), do not echo
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 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 turns the identity into root, and sudo runs the command as root after the user logs in, without needing to know the root password; in other words, all commands after the SU command are root. sudo only executes with the current statement as root.