Saturday, August 8, 2015

How to Enable a root login Over SSH Connection

Attention!Everyone should know that leaving a root access enabled for unauthorized users it's not a good security. 
But in some cases if you need  turn on root access for a while then it's not a problem at all. For example, you are trying to log into your server as root over SSH connection using PuTTY. It won't allow me to do that because it's blocked. To enable root login, you need to change some settings.

1) You can sign into a normal user account and then execute next command:
su -
2) Now you will execute all commands as root in a current terminal. And now execute next command:
nano /etc/ssh/sshd_config
3) Now search for " PermitRootLogin yes" line. If it is commented with "#" then simply remove the "#" sign. It must be like this:
# Authentication:
#LoginGraceTime 2m
PermitRootLogin yes
4) After you need to save the "/etc/ssh/sshd_config" file.
5) And at last, restart the SSH server:
service sshd restart

Now you can log in as root over SSH connection.

Subscribe To Get Free Updates!