After many trials and errors trying to setup a working sftp server for multiple groups with chrooted directory I decided to share what finally worked for me. I am a novice 2 months into Ubuntu so please don't shot me yet :) This is nothing new but I had a hard time finding a complete article that explains how can a novice like me could achieve it.

1 Answer
1

This one way would work, However simply create only one group and add as many users in the particular group so that when the user logs in to the SFTP server he will be chroot to that particular directory.

Then take the ownership of folder ( eg, Folder name is A, B, C and so on ) folder A from root to user x and restrict the access for others and and folder B take the ownership from root to user y and in that way we do not junk up the config file..

Either way is right and it all how you do based on the environment we work and the requirement.