How can I set up a working sftp server for multiple groups with a chrooted directory?
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.
Reposted from the OP's original question by:
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.
save and exit and start creating the users and group directories:
Now lets set permission to the directories. The main folder must be own by root and no one should have write access to it by any other user or group or it will result in ssh crashing after restart.
This is a guide for dummy's users like me who are new to Ubuntu and want to setup a secure sftp server for work or friends.