Jtowsk
By:
Jtowsk

How can I disable SSH login for a root user? (I am the account owner)

December 16, 2014 5k views

How can I disable SSH login for a root user? (I am the account owner)

1 comment
1 Answer

You can disable root SSH login by editing /etc/ssh/sshd_config, setting PermitRootLogin to no, and then restarting ssh:

sudo service ssh restart
  • Thanks but I need to disable SSH for ONE root user, not all.

  • There is only one root user a typical linux system. If you want to disable SSH access for a specific user, add the following line to sshd_config and restart SSH:

    DenyUsers user1 user2 ...
    
Have another answer? Share your knowledge.