1. Login first to your machine as a ‘root’ user.
2. Edit the config below.
vi /etc/ssh/sshd_config
3. Uncomment the line below and change ‘yes’ to ‘no’.
PermitRootLogin no
4. Save and exit the restart the ssh service.
/etc/rc.d/init.d/sshd restart