LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   ssh limited access (https://www.linuxquestions.org/questions/linux-newbie-8/ssh-limited-access-128344/)

macadam 12-23-2003 08:42 AM

ssh limited access
 
Hi,

I want to give a SSH access to one of my users.
But I want him to have access to his home directory ONLY.
Or it seems that he can go up in the dir tree hierarchy.

For ftp, easy to do but for ssh, I can't find any info on how to do that.

Thanks for your help

macadam

jharris 12-23-2003 08:51 AM

According to "man sshd_config" you can use AllowUsers to restrict this. Here's what is says
Quote:

shamlessly blagged from 'man sshd_config'
AllowUsers
This keyword can be followed by a list of user name patterns,
separated by spaces. If specified, login is allowed only for
users names that match one of the patterns. ‘*’ and ‘’? can be
used as wildcards in the patterns. Only user names are valid; a
numerical user ID is not recognized. By default, login is
allowed for all users. If the pattern takes the form USER@HOST
then USER and HOST are separately checked, restricting logins to
particular users from particular hosts.
HTH

Jamie...

macadam 12-23-2003 09:11 AM

thx I will try

regards,

macadam

jharris 12-23-2003 09:53 AM

BTW - remember to restart sshd for the changes to take effect!

Jamie...

macadam 12-23-2003 09:58 AM

Well the allowusers statement does not restrict users to their home dir but gives only the possibility to login or not via ssh.
I only want a specific user to access his home directory and he must not be able to go up that directory...

Thanks for your help anyway

michaelk 12-23-2003 11:03 AM

It appears that allowusers will restrict logins not restrict the users environment.

It might be possible with the permituserenvironment option.

Technoslave 12-23-2003 12:48 PM

All ssh is is a form of communication from one host to another that allows a user to login as if that user were on the box. It takes place of telnet, as in it gives "secured" communications.

The way to limit someones access once they've got in to the box is by assigning them a specially created shell that only allows them access to their directory.

jharris 12-23-2003 01:06 PM

Sorry, I misread your question!

I agree with Technoslave, a restricted shell may be your best bet. Unless you can chroot sshd into say /home so only all homedirs are available.

cheers

Jamie...


All times are GMT -5. The time now is 03:34 PM.