Block root login via SSH in Redhat, CentOS Linux

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

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...Loading...

Leave a Reply