Wednesday, October 5, 2016

How to enable ssh access for root user in Linux (debian based)?

1. Edit the /etc/ssh/sshd_config file as sudo(or root) user
        $sudo vim /etc/ssh/sshd_config
2. Modify the "PermitRootLogin" value as "yes" under "Authenticaton" Section
        After editing your sshd_config file's Authentication section will look like

sshd_config screen shot "PermitRootLogin yes"

PermitRootLogin yes

3. Save the changes (esc :wq)
4. Restart the ssh service
        $sudo /etc/init.d/ssh restart
       
5.  Now check root login via ssh from a remote machine
        (From a another/remote machine)
        $ssh root@
       
Note:
The parameter PermitRootLogin can take any of the following values namely,
    yes, without-password, forced-commands-only, no
   
   
PermitRootLogin
 "yes"                                    =    ssh root login allowed

 "without-password"         = password authentication is disabled for root.

 "forced-commands-only" = root login with public key authentication will be allowed,
                                                     but only if the command option has been specified. All
                                                     other authentication methods are disabled for root.

 "no"                                        = root is not allowed to log in.




No comments: