Root SSH Login Disabled/Not Working?

On Ubuntu and Debian since Ubuntu version 12.04 root ssh login has been disabled by default 
the following steps would be needed to re-enable root ssh login:

login to your server with ssh using the administrator user
then once you get in 
copy/paste this command:
sudo su
and when it prompts you for a password type your administrator user password again when it asks
once then you should see you are running as root user now
once you see that you are running as root user now edit this file using your preferred editor of choice for this example & since it is more simple then vim editor we will use nano in this example

nano /etc/ssh/sshd_config




if you do not have nano installed it can be installed as so:

apt-get -y update && apt-get -y install nano



once that is done you should be inside the nano editor edit this line as shown:
FROM:
PermitRootLogin without-password
TO:
PermitRootLogin yes
once you do that press ctrl key(control) and X key together and nano would ask you do you want to save it type "y" and then just click enter on when it asks the path to save the file to(the path must be /etc/ssh/sshd_config for this to work!)
once that is done run this:
# /etc/init.d/ssh restart
[ ok ] Restarting ssh (via systemctl): ssh.service.
then try opening another ssh window via your preferred ssh client & try logging in directly as root
it should work and should show this instead:
$ ssh root@yourserverip(replacing the placeholder with your actual server ip address.)
root@10.1.1.12's password:
The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law.

Was this answer helpful?

 Print this Article

Also Read

Accessing server - use ip or hostname?

Please use the ip address to connect, the hostname you see is only for easy identification by...

Running Bash Commands in the Background the Right Way [Linux]

Running Bash Commands in the Background the Right Way [Linux]  Derrik Diener  31st Mar 2016...

Adding Nameservers

Sometimes When a server is provisioned the DHCP doesnt set the Nameservers correctly   These...

Powered by WHMCompleteSolution