LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   securing ssh logins (https://www.linuxquestions.org/questions/linux-server-73/securing-ssh-logins-832231/)

dinakumar12 09-15-2010 01:08 AM

securing ssh logins
 
Hi all,

we have a public server and it can be accessed from any where through ssh.

My question is my server should not allow anyone directly to login as root user. First he should login as normal user then he should switch to root user.

is it possible.if possible how to achieve this.suggestions please.

I also have another questions is there any specific linux command is there to end other users ssh session without rebooting the server.

Thanks&regards,
Dinesh.

evo2 09-15-2010 01:19 AM

Hi,

Quote:

Originally Posted by dinakumar12 (Post 4097869)
My question is my server should not allow anyone directly to login as root user. First he should login as normal user then he should switch to user.

In your /etc/ssh/sshd_config (or similar)
Code:

PermitRootLogin no
I also have another questions is there any specific linux command is there to end other users ssh session without rebooting the server.

You can do something like
Code:

ps aux | grep ssh
Then note the pid of the process and kill it:
Code:

kill <pid>
Cheers,

Evo2.

dinakumar12 09-15-2010 01:40 AM

Hi,

Thank you very much, it works.


All times are GMT -5. The time now is 06:56 PM.