Why won't vsftpd let me log in with a virtual user account?

I would like to use vsftpd with virtual users and pam_pwdfile.so. I installed vsftpd and added two users (ramon and dragon) via htpasswd to my file /etc/vsftpd.passwd. The /etc/pam.d/vsftpd is configured to use this file.

auth  required        pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
auth    required pam_pwdfile.so pwdfile /etc/vsftpd.passwd
account required pam_permit.so

@include common-account
@include common-session

The user "ramon" is also available in /etc/passwd. A login to the ftp with the user "ramon" works as expected. But a login using "dragon" does not :/ The result is always

Login failed: 530 Login incorrect.

Since it's possible that I made a mistake I tried the exact way documented in /usr/share/doc/vsftpd/examples/VIRTUAL_USERS/README. Still no luck. I can login with the user "ramon", but not with the user "dragon".

Any ideas?


I had the same problem, but this thread helped.

Apparently vsftpd has problems with MD5 hashes. When I instructed htpasswd to use crypt() (the -d option), it suddenly worked:

sudo htpasswd -c -d -b /etc/ftpd.passwd twilight sparkle