|
FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below. |
|
Thread Tools | Display Modes |
|
|||
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 Code:
db_load-4.2 -T -t hash -f logins.txt /etc/vsftp_login.db chmod 600 /etc/vsftpd_login.db 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 [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 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 /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> What the hell is wrong? Why can't vsftp read my database generated by db_load??? |
|
|||
From /usr/local/share/doc/db4/utility/db_load.html of my OpenBSD box
Quote:
Code:
jojo jojos_secret_password zhoufengping zhoufengpings_secret_password
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
I am still not getting that to work.
Do you have a good ftp server to recommend? |
|
|||
vsftp is regarded by many as the most secure one. Bob Beck, OpenBSD developer and system admin at the Canadian Alberta University uses vsftpd for the OpenBSD.org ftp site, kindly hosted by the university.
Over the weekend I have some time to play with vsftp. Will try to get the thing working for you
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
Dear J65nko,
Thanks a lot man. Please document everything that you do. The vsftpd community on IRC is virtually non existent. You can email me @ disappearedng@gmail.com thx |
|
|||
Hi!
The right way to fire up your vsftpd server is the following: 1. Create the /etc/pam.d/vsftpd Code:
auth required /usr/local/lib/pam_pwdfile.so pwdfile /etc/vsftpd_login.db account required /usr/lib/pam_permit.so Code:
# adduser -v Username: virtual Full name: Virtual FTP user Uid (Leave empty for default): Login group [virtual]: Login group is virtual. Invite virtual into other groups? []: Login class [default]: Shell (sh csh tcsh bash rbash nologin) [sh]: nologin Home directory [/home/virtual]: Use password-based authentication? [yes]: Use an empty password? (yes/no) [no]: Use a random password? (yes/no) [no]: Enter password: Enter password again: Lock out the account after creation? [no]: Username : virtual Password : ***** Full Name : Virtual FTP user Uid : 1007 Class : Groups : virtual Home : /home/virtual Shell : /usr/sbin/nologin Locked : no OK? (yes/no): yes adduser: INFO: Successfully added (virtual) to the user database. Add another user? (yes/no): no Goodbye! Code:
htpasswd -c -b /etc/vsftpd_login.db USERNAME PASSWORD Code:
anonymous_enable=NO anon_upload_enable=NO anon_mkdir_write_enable=NO anon_other_write_enable=NO anon_world_readable_only=NO listen=YES listen_address=x.x.x.x listen_port=21 max_clients=200 # change these to whatever you want max_per_ip=5 write_enable=NO local_enable=YES pam_service_name=vsftpd pasv_min_port=50000 # change these too if you have a firewall running pasv_max_port=50999 xferlog_enable=YES chroot_local_user=YES secure_chroot_dir=/usr/local/share/vsftpd/empty/ guest_enable=YES guest_username=virtual ls_recurse_enable=NO ascii_download_enable=NO ascii_upload_enable=NO Code:
# /usr/local/libexec/vsftpd & That's it - I needed an ftp server and today I decided to install vsftpd. This is how I did it and it works like a charm Cheers, DNAeon
__________________
"I never think of the future. It comes soon enough." - A.E Useful links: FreeBSD Handbook | FreeBSD Developer's Handbook | The Porter's Handbook | PF User's Guide | unix-heaven.org |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to configure VSFTPD? | Sunsawe | FreeBSD Ports and Packages | 8 | 26th September 2009 02:28 PM |
VSFTPD SERVER | disappearedng | FreeBSD General | 1 | 21st October 2008 04:12 AM |
FreeBSD Server issues | Crypt | FreeBSD General | 4 | 10th October 2008 07:44 PM |
VSFTPd: pid file | kostromin | FreeBSD Ports and Packages | 0 | 4th July 2008 08:35 AM |
vsftpd stucks in close() | sunnyone | FreeBSD Ports and Packages | 0 | 10th June 2008 10:49 AM |