- Install vsftpd. On foresight just run:
sudo conary update vsftpd
- Create the file with username and password (/etc/vsftpd/logins.txt). The file is an alternating list of username and passwords:
tom
foo - Add the database file (This requires Berkeley DB program installed):
db_load -T -t hash -f /etc/vsftpd/logins.txt /etc/vsftpd/vsftpd_login.db
- Fix database permissions:
chmod 600 /etc/vsftpd/vsftpd_login.db
- Setup pam, Change /etc/pam.d/ftp to only contain the following lines:
auth required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login crypt=hash
account required /lib/security/pam_userdb.so db=/etc/vsftpd/vsftpd_login crypt=hash - Create virtual user:
useradd -d /home/ftp virtual
- Create /etc/vsftpd/vsftpd.conf containing the following lines:
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 - Restart vsftpd:
sudo /etc/init.d/vsftpd restart
Anytime you add a user to /etc/vsftpd/logins.txt you have to add the database again by running:
db_load -T -t hash -f /etc/vsftpd/logins.txt /etc/vsftpd/vsftpd_login.db
If you would like an account just let me know.
No comments:
Post a Comment