adidas56
March 16th, 2012, 02:20 AM
I cannot figure this out. I am trying to get virtual users set up on vsftpd, but for some reason they won't work. I just keep getting login errors. Can someone see what I am doing wrong?
Here is my vsftpd.conf
listen=YES
pasv_min_port=30000
pasv_min_port=30999
anonymous_enable=NO
local_enable=YES
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
guest_enable=YES
guest_username=virtual
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
I have added a user for virtual and it is pointing at /home/ftpsite which is owned by virtual and the virtual group and the permissions are 744.
The logins file that was used for the virtual users looks like this
guest
password
test
abc123
Then I am using the following command to create the db file
sudo db4.6_load -T -t hash -f logins.txt /etc/vsftpd_login.db
The pam file I have looks like this.
auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login
and I tried placing that in /etc/pam.d as ftp, vsftpd, and as both with no luck. When I do try to log in as a virtual user I get 530 Login incorrect. Login failed. However, if I try to login in with an actual system user then I can connect with no problems. What gives? What am I missing?
Also, here is what a log entry looks for a failed attempt
Wed Mar 14 23:08:57 2012 [pid 2] CONNECT: Client "192.168.1.104"
Wed Mar 14 23:08:57 2012 [pid 1] [test] FAIL LOGIN: Client "192.168.1.104"
Here is my vsftpd.conf
listen=YES
pasv_min_port=30000
pasv_min_port=30999
anonymous_enable=NO
local_enable=YES
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
chroot_local_user=YES
guest_enable=YES
guest_username=virtual
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd
rsa_cert_file=/etc/ssl/private/vsftpd.pem
I have added a user for virtual and it is pointing at /home/ftpsite which is owned by virtual and the virtual group and the permissions are 744.
The logins file that was used for the virtual users looks like this
guest
password
test
abc123
Then I am using the following command to create the db file
sudo db4.6_load -T -t hash -f logins.txt /etc/vsftpd_login.db
The pam file I have looks like this.
auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login
and I tried placing that in /etc/pam.d as ftp, vsftpd, and as both with no luck. When I do try to log in as a virtual user I get 530 Login incorrect. Login failed. However, if I try to login in with an actual system user then I can connect with no problems. What gives? What am I missing?
Also, here is what a log entry looks for a failed attempt
Wed Mar 14 23:08:57 2012 [pid 2] CONNECT: Client "192.168.1.104"
Wed Mar 14 23:08:57 2012 [pid 1] [test] FAIL LOGIN: Client "192.168.1.104"