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 :)