I want to be able to create a structure for hosting multiple sites. I want the user files to reside inside /var/www/sites/domain.com and the sftp access to be restricted with chroot.
I've followed some examples on how to set this up, and this is what I've done so far:
Added a new user, set the home directory and group:
useradd foobar -d /var/www/sites/foobar.com -g sftp
/etc/ssh/sshd_config I've added:
Match Group sftp X11Forwarding no ChrootDirectory %h AllowTcpForwarding no ForceCommand internal-sftp
and restarted the service
/etc/vsftpd/vsftpd.conf to include the following changes:
and restarted vsftpd
I've set ownership of /var/www/sites to root and /var/www/sites/foobar.com to foobar
But when I try to connect via sftp using filezilla I get this:
Error: Authentication failed. Error: Critical error: Could not connect to server
Username and password given to filezilla are correct of course
What am I missing?