LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Configuring SSH (https://www.linuxquestions.org/questions/linux-general-1/configuring-ssh-277353/)

XaViaR 01-13-2005 11:04 AM

Configuring SSH
 
I was wondering what is the easiest and best way to specify what users will have access to ssh into a machine. I would like to give ssh access to only some users and not all.

Thanks in advance for you help,

Xaviar

makuyl 01-13-2005 11:34 AM

You can set it in /etc/ssh/sshd_config or /etc/sshd_config

To use groups you could add the following lines:
AllowGroups ssh
DenyGroups *

To use userpermissions you could try with:
AllowUsers username1 name2 name3
DenyUsers *

XaViaR 01-13-2005 11:40 AM

Thanks for you help!

druuna 01-13-2005 11:50 AM

Hi,

Quick and dirty:

groupadd sshusers <= create new group
chmod 750 /usr/bin/ssh <= remove world execute, owner and group only
chgrp sshusers /usr/bin/ssh <= change group to sshusers

Only users that are member of the sshusers group have acces to ssh (and root ofcourse). To make someone member of the sshusers group:

usermod -G sshusers (read the manpage about the -G switch!!!!)

You migth want/need to do this with the other ssh tools too.

Hope this helps.

druuna 01-13-2005 11:52 AM

Hi again,

I just noticed that you can read this questions 2 ways:

1) Allow/Disallow outside people onto your box (makuyl answered that one)
2) Allow/disallow local user to use ssh to go outside (my answer)


All times are GMT -5. The time now is 11:56 AM.