Most Linux distributions allow the root user to connect in via SSH, and CentOS is no exception. It is recommended that root logins are never used, and you should use either su or sudo to elevate the permissions of a normal user account. As such, the best option is to disable root logins in the SSH server configuration file.
Note: these commands should be run as a user with root privileges (sudo or su), or from the console as root.
Open the /etc/ssh/sshd_config file in your editor of choice (vi in this example):
# vi /etc/ssh/sshd_config
There should be a line containing the following:
Edit this to read:
(Make sure you un-comment the line too)
Save the file and exit the editor.
Restart the SSH server:
# service sshd restart
# /etc/init.d/sshd restart
Root logins over SSH should now be disabled.