It is a big security hole to allow users to directly login to SSH via root. To avoid and also to avoid brute force attack to your server you may want to disable direct root login via SSH to your server. Below are the exact steps to disable direct root login to server via SSH:
1. Login to server as a root via SSH.
2. Open the file /etc/ssh/sshd_config via vi /etc/ssh/sshd_config.
3. Find the line Protocol 2, 1 and replace it to Protocol 2
4. Uncomment the line "PermitRootLogin" no
5. Restart sshd service via /etc/init.d/sshd restart command.
That's it!
1. Login to server as a root via SSH.
2. Open the file /etc/ssh/sshd_config via vi /etc/ssh/sshd_config.
3. Find the line Protocol 2, 1 and replace it to Protocol 2
4. Uncomment the line "PermitRootLogin" no
5. Restart sshd service via /etc/init.d/sshd restart command.
That's it!