How to disable root login in Linux

It is a good idea to disable root login for security purposes and use your login name and use sudo to get root privileges.

First of all, make sure you have your own login name and you can get root privileges by using sudo.

So, open up /etc/ssh/sshd_config and comment out
AllowUsers root

so it will look like:

#AllowUsers admin

You will need to restart sshd in order to have this setting take effect.


Didn't find what you were looking for? Try these links:

You can follow any responses to this entry through the RSS 2.0 feed.