Deny ssh root login
We are going to see how to deny ssh root login. Login in as root user through ssh is an security breach. If some hacker got root password they can crash the whole linux machine. Always prevention is better than cure so disabling or denying ssh root login is always highly recommended. Previously we have seen tips for secure shell and ssh password less login.
There are two machines with IP address 192.168.1.8(client) and 192.168.1.9(server). Direct root login is enabled in 192.168.1.9(server) and we have to disable it.
Lets learn the steps to deny ssh root login.
Open ssh configuration fule /etc/ssh/sshd_config and search with keyword PermitRootLogin. Change it to “PermitRootLogin no” and save the file. Check the syntax of the configuration file using command “/usr/sbin/sshd” if nothing is displayed then every thing is fine. Then restart sshd service.
Check whether direct root login is working or not.
Ssh direct root login is disabled task accomplished.