SSH - get multiple user acces to ony one folder

0

maybe silly question, but I have no experiences to this.

I have server and I need to get access multiple user via SSH to upload the files to my server.

I want the other users can see only this folder and can not listing other files system.

My OS is Red Hat.

I tried:

adduser share
passwd share (set for example 123)

When I try to access from other computer to this server (folder)

shh share@IP

I can list all the files not only in directory share. Any idea how to create only access to user share with write access?

Geroge

Posted 2017-10-26T17:30:51.133

Reputation: 101

"I want the other users can see only this folder and can not listing other files system." - If they have read permissions on the folder it means they will be able to see the contents the folder. "Any idea how to create only access to user share with write access?" - You should only only be giving read access to folders that they have read access to. – Ramhound – 2017-10-26T17:43:42.653

(1) You might want to do this in the long run, for for now, calling the directory and the user by the same name is just going to confuse matters — especially since the question is asking about multiple users.  (2) Have you done any research into how to restrict permissions in Linux?  It can be tricky, but please try to solve this yourself, and let us know where you got stuck.  Hint: Naming the directory and the user by the same name has no effect on permissions.  P.S. What’s shh?  Do you mean ssh? – G-Man Says 'Reinstate Monica' – 2017-10-26T17:47:14.180

I did try a lot but don't have any experience with permission in linux. shh was typo I meant ssh .. – Geroge – 2017-10-26T18:01:42.123

Naming was only illustrative example. – Geroge – 2017-10-26T18:02:10.377

Would be best served by sftp without shell access at all. Here's an example: https://passingcuriosity.com/2014/openssh-restrict-to-sftp-chroot/

– A.B – 2017-10-26T18:05:19.047

Answers

0

You can use the restricted command when creating your new user to specify which folder he has access to.

Something like:

adduser --home /restricted/directory restricted_user

I think this feed will help too by giving a good example: ssh user with limited access

hackela

Posted 2017-10-26T17:30:51.133

Reputation: 33