How to make SSH login as root

15 October 2015, Thursday 0 Comments

Give permission to root user to make SSH connection

To login server as root, we should set a password to root user.

sudo passwd root

After that root access should be permitted. To make this, we will modify sshd_config file.

sudo nano /etc/ssh/sshd_config

Find the "PermitRootLogin" line and replace it with "PermitRootLogin yes".

Restart sshd service now to affect changes (for Ubuntu: service ssh restart).

sudo service sshd restart

From now on you can access your server via SSH as root with username and password.

Share this