Ubuntu – How to set up a writeable sftp chroot


I am setting up a file server in Ubuntu Server 16.04.

I've got 3 users (and 6 hard drives, 2 each in a RAID 1 config). These Raided drives are mounted to /mnt/username, which have been set as the user's home directory. I have set up SFTP with SSH keys and login is a breeze. However, I do not want userA to leave /mnt/userA and gain access to /mnt and see the other user's folders.

To remedy this I set up chroot in sshd_config for each user, to their directories. This however prevents the user from writing to their folder (which is useless as far as a file server is concerned).

How do I jail a SFTP user to their home directory, while still allowing their home directory to be writeable by them?

Best Answer

Related Question