How to Enable or Disable root Login

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

  1. Log into your server via SSH.
  2. Open the SSH configuration file:
    sudo nano /etc/ssh/sshd_config
  3. Find the line PermitRootLogin yes and change it to:
    PermitRootLogin no
  4. 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.

  • root login, security
  • 0 gebruikers vonden dit artikel nuttig
Was dit antwoord nuttig?

Gerelateerde artikelen

How to Reset Your Server Password

If you've forgotten your server password or need to reset it for security reasons, Circle City...

How to Connect via RDP on Windows Servers

Remote Desktop Protocol (RDP) allows you to connect to your Windows server with a graphical...

How to Use SSH Keys for Secure Login

SSH keys provide a more secure way to log into your server than passwords alone. This article...

How to Use SSH Keys for Secure Login

SSH keys provide a more secure way to log into your server than passwords alone. This article...

How to Change Your SSH Port

Changing the default SSH port from 22 to a custom port can help reduce automated login attempts....