Disable Root Login in CentOS/Red Hat – Assalamualaikum, this article will inform how to setup disable root login in CentOS/Red Hat. This configuration aims to prevent the access of those who are not permitted and only certain users can access the server.
- open file /etc/ssh/sshd_config using vim / nano
# vim /etc/ssh/sshd_config
- Add following this line in the bottom
# Disable Root Login
PermitRootLogin no
UseDNS no
- Restart service ssh
# systemctl restart sshd
Note : Before you disable root login, you MUST create a new user and give sudoers access, because if you don’t create a new user then your server will not be accessible
Read this : Menambahkan User ke Sudoers di CentOS/Red Hat
May be usefull & enjoy, wassalamualaikum