Skip to main content

Disable root login via SSH

Sabrina Goom avatar
Written by Sabrina Goom
Updated over a month ago

To disable root login, edit the SSH config file using:

sudo nano /etc/ssh/sshd_config

Find the line "PermitRootLogin" and set it to "no", then save and exit the file

After that, restart SSH with:

sudo systemctl restart sshd

Make sure you have a separate user with sudo privileges before disabling root login.

Did this answer your question?