How to Disable root Login on Centos 8?

Enabling a root access through SSH on open internet is surely a security vulnerability.

Hence, it is best to disable root access from the get-go.

All you have to do is to edit the SSH service’s config file /et/ssh/sshd_config

Use vi or nano or your favorite text editor and find below text:

#PermitRootLogin no

and update it to:

PermitRootLogin no

and then reboot the sshd service if you are already using root accout:

systemctl restart sshd.service

if you are not logged on as ‘root’, please don’t forget to sudo the above command:

sudo systemctl restart sshd.service

Posted

in

by

Tags:

Comments

Leave a Reply

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