7

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?

3

4 Answers 4

6

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
0

Use below to configure.

http://en.gentoo-wiki.com/wiki/Vsftpd#b.29_pam_pwdfile

I have tried this on my setup & it is working as expected.

0

Adding the -d option to htpasswd worked on my Rackspace / Ubuntu setup: htpasswd -c -d passwd username.

0
0

Install:

apt install vsftpd libpam-pwdfile

Make user:

useradd -N -s /bin/false -d /home/vsftpd vsftpd

Edit/Create files:

# /apt/pam.d/vsftpd
auth required pam_pwdfile.so pwdfile /etc/vsftpd/ftpd.passwd
account required pam_permit.so

# /etc/vsftpd.conf
listen=YES
#listen_ipv6=YES
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
xferlog_enable=YES
nopriv_user=vsftpd
chroot_local_user=YES
pam_service_name=vsftpd
utf8_filesystem=YES
hide_ids=YES
user_config_dir=/etc/vsftpd_user_conf
guest_enable=YES
virtual_use_local_privs=YES
pam_service_name=vsftpd
guest_username=vsftpd

# /etc/vsftpd/ftpd.passwd
# user names without passwords
# user name 'upload' has a password.
# if real password is 'MyPassword' then hash created with command:
# openssl passwd MyPassword
programming:
videos:
documents:
furnitures:
sound:
engineer:
games:
programs:
shits:
upload:X7nyBRuyuJVyg

# /etc/vsftpd_user_conf/documents
local_root=/media/nas/Έγγραφα

# /etc/vsftpd_user_conf/engineer
local_root=/media/nas/Μηχανικός
hide_file={/_unsorted_,/personal}

# /etc/vsftpd_user_conf/upload
local_root=/media/nas/downloads/FTP upload
download_enable=NO
write_enable=YES
allow_writeable_chroot=YES

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .