Limit every user to his own home folder only

6

2

i have a linux server which users connect to with SSH. my users only upload and download content from their /home folder.

Basicly, I want them to be limited to see and use only their home folder.

I read that it might not be a good idea to do so, since they nead read premissions to run programs and scripts, but again: they are only downloading\uploading content to their home dir.

How can I do it?

user83493

Posted 2011-07-12T07:06:04.647

Reputation: 71

Answers

9

Follow this guide to configure your SSH server to chroot your users.

Essentially, use the ChrootDirectory and ForceCommand rules for sshd_config to limit certain users or groups (Match Group or Match User) to SFTP and a specific directory.

This requires use of the rule Subsystem sftp internal-sftp as well, unless the ChrootDirectory contains all files for a real chroot environment (like a /dev directory with some basic devices)


A different possibility would be to disable shell login. SCP and SFTP might still work for them.

Daniel Beck

Posted 2011-07-12T07:06:04.647

Reputation: 98 421

0

You could also install webmin on the server http://www.webmin.com/ with webmin you will be able to set limits as to what the users can do and access. Its pretty easy as well.

roykasa

Posted 2011-07-12T07:06:04.647

Reputation: 299

0

I'm not really good at bash, but Google led me to a link regarding restricted bash for user accounts. Hope It helps.

Sundar

Posted 2011-07-12T07:06:04.647

Reputation: 1

1

Welcome to Super User! Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.

– slhck – 2013-05-24T07:54:20.773