Other Articles

Servers – Disable SSH Root Login

Support > Fixing Checks > Server

06 March, 2026

This check ensures that SSH root login is disabled on the server.

Allowing direct root login over SSH increases the risk of unauthorized access and makes auditing difficult. Disabling root login enforces secure access practices by requiring users to authenticate with individual accounts.

Check Details

  • Resource: Server
  • Check: Disable SSH root login
  • Risk: Enabling root login over SSH can allow attackers to directly target the root account, leading to potential full system compromise and lack of accountability.

Remediation Steps

  1. Open a terminal session on the server with root or sudo privileges.
  2. Open the SSH configuration file using a text editor.

    sudo nano /etc/ssh/sshd_config
    
  3. Locate the following parameter in the file: PermitRootLogin
  4. Modify or add the parameter to disable root login:

    PermitRootLogin no
    
  5. Save the file and exit the editor.
  6. Restart the SSH service to apply the changes.

    sudo systemctl restart sshd
    
  7. Verify that root login is disabled by running:

    sshd -T | grep permitrootlogin
    
  8. Ensure the output shows: permitrootlogin no