NEWBIE: Why does my vsftpd hang when I log in using virtual users?
I'm using RedHat 9 and trying to get vsftpd to work with virtual users.
I've followed the documentation in the EXAMPLE directory on vsftpd.beasts.org
This is what I have tried;
1) logins.txt:
tom
foo
fred
bar
2) Make login.db
db_load -T -t hash -f logins.txt /etc/vsftpd/vsftpd_login.db
3)Modify the file's permission:
chmod 600 /etc/vsftpd/vsftpd_login.db
4)Create a PAM file which uses your new database
/etc/pam.d/ftp:
auth required /lib/security/pam_userdb.so db=/etc/vsftpd_login
account required /lib/security/pam_userdb.so db=/etc/vsftpd_login
5)Set up the location of the files for the virtual users:
useradd -d /home/ftpsite virtual
ls -ld /home/ftpsite
(which should give):
drwx------ 3 virtual virtual 4096 Jul 30 00:39 /home/ftpsite
6)Create /etc/vsftpd/vsftpd.conf config file:
anonymous_enable=NO
local_enable=YES
write_enable=NO
anon_upload_enable=NO
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
chroot_local_user=YES
guest_enable=YES
guest_username=virtual
listen=YES
listen_port=10021
pasv_min_port=30000
pasv_max_port=30999
7) start the daemon:
vsftpd /etc/vsftpd/vsftpd.conf &
8)ftp localhost 10021
Connected to localhost (127.0.0.1).
220 (vsFTPd 1.2.1)
Name (localhost:root): tom
331 Please specify the password.
Password: (not shown but I use 'foo' here)
at this point it just hangs sitting there doing nothing and then after a couple of minutes or so returns the following;
421 Timeout.
Login failed.
No control connection for command: No such file or directory
So I set this option in vsftpd.conf
anonymous_enable=YES
and try to log in using
userid: ftp
pw: guestftp
and it all works fine as follows;
Connected to localhost (127.0.0.1).
220 (vsFTPd 1.2.1)
Name (localhost:root): ftp
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (127,0,0,1,118,249)
150 Here comes the directory listing.
drwxr-xr-x 2 0 0 4096 Feb 28 2003 pub
226 Directory send OK.
ftp> close
can anyone help? I have looked in /var/log/messages and theres no error in there and i've looked for /var/log/vsftpd.log and that is empty.
I'm a linux newbie (only a few months) but I have been using other operating systems for many years.
Any help would be greatly appreciated.
Pete
|