View Single Post
  #1   (View Single Post)  
Old 21st October 2008
disappearedng disappearedng is offline
Shell Scout
 
Join Date: May 2008
Posts: 128
Default VSFTPD Server Issues!!

Hi everyone
I followed the guide provided by vsftp's examples and I can't get my desired username and password to work.

1) I have create a file in /etc/
Code:
[root@192 /usr/local/etc]# cat /etc/logins.txt 
jojo
zhoufengping
2) I loaded the file into berkeleyDB
Code:
db_load-4.2 -T -t hash -f logins.txt /etc/vsftp_login.db 
chmod 600 /etc/vsftpd_login.db
3) I Created a pam file, /etc/pam.d/vsftpd.pam
Code:
[root@192 /etc]# cat /etc/pam.d/vsftpd.pam 
auth    required /usr/local/lib/pam_pwdfile.so pwdfile /etc/vsftpd_login.db
account required /usr/lib/pam_permit.so
4) I created a new user virtual with NO PASSWORD
[code]
cat /etc/passwd | grep virtual
virtual:*:1002:1006:virtual:/usr/mount/50gb/ftp:/usr/sbin/nologin
[code]

5) And then I followed the guide and copied /etc/hosts to my ftp area
Code:
cp /etc/hosts /usr/mount/50gb/ftp/
chown virtual:virtual /usr/mount/50gb/ftp/hosts
6) Now this is my conf
Code:
[root@192 /etc]# cat /usr/local/etc/vsftpd.conf
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=21

secure_chroot_dir=/usr/local/share/vsftpd/empty
7) And I started my server
/usr/local/libexec/vsftp &
No error

8)However, when I try to login,
Code:
[root@192 /etc]# ftp localhost
Trying 127.0.0.1...
Connected to localhost.
220 (vsFTPd 2.0.7)
Name (localhost:root): zhou
331 Please specify the password.
Password:
530 Login incorrect.
ftp: Login failed.
ftp> close
221 Goodbye.
ftp> ftp localhost
Trying 127.0.0.1...
Connected to localhost.
220 (vsFTPd 2.0.7)
Name (localhost:root): virtual
331 Please specify the password.
Password:
530 Login incorrect.
ftp: Login failed.
ftp> close
221 Goodbye.
ftp>
None of my user names work.

What the hell is wrong? Why can't vsftp read my database generated by db_load???
Reply With Quote