Allow SSH Login as Root User

This page will explain how to allow the root user to login via SSH.

Warning

This feature is disabled by default for security reasons.

  1. Open the SSH configuration file on your server:

    sudo nano /etc/ssh/sshd_config
    
  2. Look for the line that says PermitRootLogin and remove the comment #.

  3. By default, the value of PermitRootLogin is often set to prohibit-password or no. Change it to yes if you want to allow root login:

    sshd_config
    PermitRootLogin yes
    
  4. Restart the SSH Service to apply the changes:

    sudo systemctl restart sshd