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:
 

One Response to Block root login via SSH in Redhat, CentOS Linux

  1. [...] Always use SSH Protocol version 2. Because protocol 2 supports DSA, ECDSA and RSA keys. 2. Block direct “root” user login from the remote machine. 3. Allow only specific users or group members to login via ssh 4. Always use key based [...]

Leave a Reply

%d bloggers like this: