ubuntu 18.04 ssh login with root user

The default root user of Ubuntu system cannot log in, and the password is also empty.

If you want to log in with the root user, you must first set a password for the root user

Open a terminal, type: sudo passwd root and press enter

At this point you will be prompted to enter a password, enter the password of the user you are currently logged in after password:

In the ubuntu system, the default is to disable ssh and use the root user to log in. The following configuration is made in the /etc/ssh/sshd_config configuration file:

# Authentication:

#PermitRootLogin without-password

Uncomment PermitRootLogin without-password and modify it to PermitRootLogin yes.

Then restart ssh, sudo service ssh restart. This will allow you to log in as root user
 

{{o.name}}
{{m.name}}

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=324078871&siteId=291194637