Securing SSH is an important task of every system admin. There are many options available to secure openssh service. One of the primary part of the task is blocking or deny direct root login via SSH. This guide explains you how to deny or disable or block root login via SSH in CentOS, Redhat linux servers.

I’m going to edit the ssh configuration file in the global configuration directory. Open your terminal and login as root user

1. Open the file /etc/ssh/sshd_config

2. Change the value of PermitRootLogin yes to no.

PermitRootLogin no

3. Restart the ssh service

/etc/init.d/sshd restart

Related articles

Subscribe Our Free Newsletter

Delivered by FeedBurner. We Respect Your Privacy

Tagged with:

Leave a Reply