How to disable root login on CentOs VPS

Root login should ideally be disabled due to security reasons.

To disable root login edit the sshd_config file using vi or any other editor

 sudo vi /etc/ssh/sshd_config

The above command would open up the sshd_config file

disable root login in centos
Change the line
#PermitRootLogin yes to PermitRootLogin no

After making the change restart sshd

sudo systemctl restart sshd
Previous Post
Installing and configuring fail2ban on CentOs 7
Next Post
How to disable direct ip access on CentOs VPS

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

alert('dsf'); console.log("dsdsdsd");