Thursday, January 5, 2012

Disable Root SSH Login on Linux


 #vi /etc/ssh/sshd_config

Find this section in the file, containing the line with “PermitRootLogin” in it.

    #LoginGraceTime 2m
    #PermitRootLogin no
    #StrictModes yes
    #MaxAuthTries 6

Make the line look like this to disable logging in through ssh as root.

    PermitRootLogin no

Then  restart the sshd service:

   # /etc/init.d/sshd restart