SSH root connection in Ubuntu

Once I needed to use rsync to copy a lot of data from the server to which only the root user had access, so I allowed the root user to connect via ssh.

By default in Ubuntu, the root user does not have a password, so we will create one if it has not already been done:

sudo passwd root

Then open the SSH server configuration file in any text editor, for example nano (CTRL+x to exit):

sudo nano /etc/ssh/sshd_config

Find the PermitRootLogin parameter and change it to yes to allow the root user to connect:

PermitRootLogin yes

Restart ssh to apply the changes:

service sshd restart

See also my articles:
Installing and configuring SSH
Connect to SSH using the keys
Linux User Administration

Leave a comment

Leave a Reply