Disable SSH root login
Disabling root login via SSH
Disabling SSH root login will add an extra layer of security. It would be more secure to brute force
attacks or in case your password is stolen.
- Create a non-root user
adduser usernamepasswd username - Open the ssh configuration file with your editor.
vi /etc/ssh/sshd_config - Add the line “PermitRootLogin no.” Or uncomment the line "#PermitRootLogin yes" and
change yes to no.#LoginGraceTime 2m#PermitRootLogin yes#StrictModes yes#MaxAuthTries 6#MaxSessions 10PermitRootLogin no - Save and exit the file.
- Restart the ssh service
systemctl restart sshd.service