How to use the root user to log in to the instance in the Ubuntu system

The default user name of the Ubuntu system is ubuntu, and the root account and password are not set by default during the installation process. If necessary, you can enable root user login in the settings. The specific operation steps are as follows:

1. Use the ubuntu account to log in to the lightweight application server.

2. Execute the following command to set the root password.

 
 

sudo passwd root

3. Enter the root password and press Enter .

4. Repeat the root password and press Enter . If the following information is returned, it means that the root password is set successfully.

 
 

passwd: password updated successfully

5. Execute the following command to open sshd_configthe configuration file.

 
 

sudo vi /etc/ssh/sshd_config

6.

Press i to switch to edit mode, find #Authenticationand PermitRootLoginchange the parameter to yes. If PermitRootLoginthe parameter is commented, please remove the comment symbol ( ) in the first line #. As shown below:

7. Find #Authenticationand PasswordAuthenticationchange the parameter to yes. As shown below:

illustrate

If sshd_configthere is no such configuration item in the configuration file, PasswordAuthentication yesjust add the item.

8. Press  Esc , type :wq , save the file and return.

9. Execute the following command to restart the ssh service.

 
 

sudo service ssh restart

10. Refer to Logging In to a Linux Instance Using Remote Login Software , and use the following information to log in to the Ubuntu lightweight application server:

Username: root

Login password : the password set in step 2

 

 

Guess you like

Origin blog.csdn.net/txl910514/article/details/131225224