For security, many administrators disable direct root login over SSH and use a regular user account with sudo privileges instead. This article explains how to manage root login.
Disable Root Login
- Log into your server via SSH.
- Open the SSH configuration file:
sudo nano /etc/ssh/sshd_config - Find the line
PermitRootLogin yesand change it to:PermitRootLogin no - Save the file and restart SSH:
sudo systemctl restart sshd
Enable Root Login
To allow root login, set:
PermitRootLogin yes
Then restart the SSH service.
Important
Make sure you have a non-root user with sudo access before disabling root login. Otherwise, you may lock yourself out.
Need Help?
If you need assistance, contact us through the Circle City Servers Support Portal.