Ubuntu

Ubuntu immediately after installation, the terminal can not run the su command, because there is no default root password, you need to manually set.


When you install ubuntu user name to enter the login, the user in the admin group have permission to set the root password.


Set a password for the root user specific steps:
1. Open a terminal, then enter the following command
sudo passwd [root]


 after the carriage return will let you enter the original password, the new password and confirm the password,
 [sudo] password for you: - -> enter your password (user password you are now), does not echo
 enter new UNIX password: ---> set the root password
Retype new UNIX password: -> repeat this
so that your root password set up .
Note: root can be omitted, as the passwd command instead of password, I made this mistake.

2. In the terminal using su command can switch to the root user.

NOTE: su difference and sudo are: 1) su root password is the password, and the password is sudo user's password;.

. 2) su directly to become root identity , based on user login and sudo to run commands as root, you do not need to know the root password;

 

Released six original articles · won praise 1 · views 9188

Guess you like

Origin blog.csdn.net/qq_39715243/article/details/80541367