this short tutorial will show you what commands to use to disable root user login to a ssh terminal. this configuration will prevent users from login into SSH session using the root username. disabling root username in sshd is easy with these steps:


WARNING: it is IMPORTANT that you make sure before you continue with these steps that you either have created or create another user other than root so you can access your server through SSH. Otherwise, if you only have root username in your system, you will just lock yourself out from remotely accessing your server. Continue at your own RISK!!!

login as superuser and edit the /etc/ssh/sshd_config file

first thing we are going to do is to make a copy of the original sshd_config file just incase you mess up:
SHELL COMMAND:
cp /etc/ssh/sshd_config /etc/ssh/sshd_config-bk


i will be using nano as my text editor, you can use your favorite if you want. like VI or pico. i like nano because its easy to use
SHELL COMMAND:
nano /etc/ssh/sshd_config


now uncomment the Protocol 2 line:
find:
#Protocol 2

Change to:
Protocol 2

now look for the PermitRootLogin configuration settings and change:

from:
PermitRootLogin yes

to
PermitRootLogin no

save changes and exit the shell, it order for the changes to take affect you need to restart the sshd server with this command:

SHELL COMMAND:
/etc/rc.d/init.d/sshd restart


now quit the current shell session and start a new one, you should not be able to login as the root user anymore

NOTE: this was tested on a Redhat, Fedora, CentOS server