LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Need Help Create ssh user who can only access one directory (https://www.linuxquestions.org/questions/linux-newbie-8/need-help-create-ssh-user-who-can-only-access-one-directory-4175533477/)

odie 02-09-2015 01:44 AM

Need Help Create ssh user who can only access one directory
 
hi linus guru,


Need your help, I would like to create ssh user that only has access to one folder

existing Directory: /home/aps/logs



user can only have read only access on logs folder

Thanks, appreciate your help..

TB0ne 02-09-2015 09:07 AM

Quote:

Originally Posted by odie (Post 5314235)
hi linus guru,
Need your help, I would like to create ssh user that only has access to one folder existing Directory: /home/aps/logs

user can only have read only access on logs folder

Please see the "Question Guidelines" link in my posting signature. You don't provide any details, such as version/distro of Linux, or what you've done/tried so far, or what version of SSH. Since 4.8.1, you have a "ChrootDirectory" directive, which you can see in the SSHD documentation, or in the man page of sshd_config. The easiest course of action is to set your user(s) to be in a particular group, then shove something like this:
Code:

Match group jailedusers
          ChrootDirectory /home/jailed
          AllowTcpForwarding no

Restart SSH, and any users in the "jailedusers" directory will ONLY see their home directory, and nothing else.


All times are GMT -5. The time now is 08:50 AM.