On my Ubunut server 12.04 LTS machine, I try to add a user with only sFTP or FTP access. Let's call him 'Jim' for now. Jim only needs access to a directory /var/www/example.com.
So far I've tried both vsftpd and openSSH, both to no avail.
I have OpenSSH installed correctly and I can use sFTP for my own account. But I can reach all directories and use SSH which should both not be possible for Jim.
I've tried several tutorials including:
At current stage I have a user account for Jim, and he can't get SSH access. I changed his home directory to /var/www/example.com. Which is from www-data:users, Jim is part of the users group and the sftponly group. There are no changes made to sshd_config to limit Jim's options.
When I try to add Match User jim
or Match Group sftponly
and supply any option like ChrootDirectory
SSH won't be able to restart.
When I restart the service I don't get any notice but when taking a look with ps -ae | grep ssh
ssh is not listed. If I remove the Match
directive SSH will properly restart.
Can anyone give me a hint how to finish my sFTP or FTP setup?
I would prefer to have a setup where ftp users wouldn't be local users but separate managed virtual users.