Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

First thank you very much for all your post. I am completely new to Ubuntu and the Unix world and have found almost all the answers I needed except how to properly setup and sftp server with chrooted directories.

What I would like to do is create an SFTP server with multiple groups accessing only one directory depending on the group the user is at.

Ex.1 Group-A (user1,user2 and useer3) have access to /home/research
Ex.2 Group-B (user4, user5 and user6) have access to /home/projetcs

If I just setup the user and assing then the same home directory that works as far as accessing the sftp and uploading files. But the user is able to view the directory tree and able to download files from any other users and that is not aceptable for what I need to do.

sudo mkdir /home/research
sudo mkdir /home/projects

useradd user1 -d /home/research
useradd user4 -d /home/projects
chmod 775 /home/research
chmod 775 /home/projects

vi /etc/ssh/sshd_config
Subsystem sftp internal-sftp
Match Group research
ChrootDirectory %h
AllowTcpForwarding no
ForceCommand internal-sftp

How can I have multiple groups with full access to their own directories and without access to any other directories? Thank you this is my first post :)

share|improve this question
I mess up my system. I tried to fix the permission by giving root owner rights to all the all files by running "chown root:root /" after this I was not able to login and as soon as I tried it it kick back to the logon screen. – SPeedY Feb 26 '13 at 17:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.