After Ubuntu has just been installed, you cannot run the SU command in terminal because Root does not have a default password and needs to be set manually.
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:---> Set 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.
2. 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;
The SU initial password setting for Ubuntu