If your disto doesn't come with PAM, then you'll need to grab a copy, as vsftpd uses PAM for authentication of virtual users.
There is a debian package for pam_pwdfile already available, alternatively, download and compile it, if your copy of linux doesn't come with it already:
apt-get install libpam-pwdfile
First, create a password file for the first user:
htpasswd -c /etc/vsftpd/passwd user1
And then:
htpasswd /etc/vsftpd/passwd user2
Next you need to edit the vsftpd configuration file /etc/vsftpd.conf
You need to use the per-user config files in order to specify a unique chroot location for them. In your case the per-user config "local_root" will be varying values outside of /var/www/sites/ as required.
This can be done very easily with PAM.
If your disto doesn't come with PAM, then you'll need to grab a copy, as vsftpd uses PAM for authentication of virtual users.
There is a debian package for pam_pwdfile already available, alternatively, download and compile it, if your copy of linux doesn't come with it already:
First, create a password file for the first user:
And then:
Next you need to edit the vsftpd configuration file /etc/vsftpd.conf
Finally you need to configure PAM to use the password file, so edit /etc/pam.d/vsftpd
Don't forget to restart vsftpd, and that's pretty much it!
Yes, it's possible, see my post here:
vsftpd - local_root=/var/www/sites/$USER doesn't get interpreted?
You need to use the per-user config files in order to specify a unique chroot location for them. In your case the per-user config "local_root" will be varying values outside of /var/www/sites/ as required.