LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   SSH configuration (https://www.linuxquestions.org/questions/linux-software-2/ssh-configuration-4175486106/)

raghu88 11-27-2013 10:40 PM

SSH configuration
 
Hi,
getting the warning from Root Hunter when I run a check

Warning: The SSH configuration option 'PermitRootLogin' has not been set.
The default value may be 'yes', to allow root access.

any one explain me briefly i'm new to linux and if it is set then what happens? how to set?

Thanks.

evo2 11-27-2013 10:45 PM

Hi,

normally ssh root access should be disabled. If a remote user wants root access they should ssh to the box as a normal user and then su to root. This is a security policy, the reason being that all *nix machines have a root user, so by disabling ssh as root an attacker will need to "guess" both the username and the password.

In short you should probably add the following line to your /etc/ssh/sshd_config
Code:

PermitRootLogin no
HTH,

Evo2.

raghu88 11-27-2013 11:14 PM

i want to make sure once,

If PermitRootLogin is set to no then remote user can't login as root user right?

evo2 11-27-2013 11:18 PM

Hi,
Quote:

Originally Posted by raghu88 (Post 5071792)
i want to make sure once,

If PermitRootLogin is set to no then remote user can't login as root user right?

Correct - if we are only considering ssh.

Cheers,

Evo2.

haertig 11-27-2013 11:28 PM

Quote:

Originally Posted by raghu88 (Post 5071792)
i want to make sure once,

If PermitRootLogin is set to no then remote user can't login as root user right?

Just so you are 100% clear, with this setting a remote user cannot directly login as root via ssh. However, they can ssh in as a normal user. Then once logged in this way, they can login to root from the command line (given they know the root password, or have been configured in /etc/sudoers, etc.)

Also, after you put this PermitRootLogin directive in /etc/ssh/sshd_config, you must force the currently running ssh daemon to reload its configuration. On many systems, the following will accomplish that:

Code:

sudo /etc/init.d/ssh reload
"reload" is safer than "restart". If you were ssh'ed into your machine, messed up the sshd_config file by accident, and then issued a "restart" command and ssh failed to restart (because you goobered up its config file), then you could end up locking yourself out.

kooru 11-28-2013 01:23 AM

Hi and welcome to LQ!
In addiction, I suggest some reading about ssh configuration that can be useful.

http://www.cyberciti.biz/tips/linux-...practices.html
https://signalboxes.net/misc/hardening-ssh/


All times are GMT -5. The time now is 09:16 AM.