How to Enable Debian root SSH Login – Permit root ssh access in Debian Linux 8

In the last tutorial we install openssh server on Debian Linux. In This tutorial we are going to learn how to allow root ssh login in debian Linux.

By default Debian Linux does not allow to log in to the server as root user via the SSH Protocol. Debian ssh root login has been disabled from the main ssh configuration File. If you tried to login as root user, you will receive the error message "Permission denied, please try again".

It is is not good practice to permit SSH root Access due to security reasons. But for your knowledge, let's see how it is done.

Set PermitRootLogin yes in sshd_config File

PermitRootLogin parameter in /etc/ssh/sshd_config file control the ssh root permission. By default the value of PermitRootLogin is "without-password" in Debian Linux. To Permit root login we need to set PermitRootLogin to yes.

So first open the ssh configuration file using a text editor.

vim /etc/ssh/sshd_config

Then change the value of PermitRootLogin to yes

PermitRootLogin yes

How to Enable Debian root SSH Login - Permit root ssh access in Debian Linux 8

Then Save the ssh configuration file and restart the ssh service using systemctl command.

systemctl restart ssh.service

Now you should be able to access your debian server using the root user account via SSH Protocol.

Ssh root login in debian has been disabled by default because it is not recommended to use the root password via ssh. What you should normally do is ssh to the server as a regular Linux user, then use the su command to login as root user.