Linux technical support - support@alexlinux.com


vsftpd virtual users centos 7 example

vim /tmp/users.txt
alex
pa$$wd

yum install db4-utils db4 vsftpd
vi /tmp/users.txt
db_load -T -t hash -f /tmp/users.txt /etc/vsftpd/virtual_users.db
# cat /etc/vsftpd/vsftpd.conf
anonymous_enable=NO
local_enable=YES
virtual_use_local_privs=YES
write_enable=YES
allow_writeable_chroot=YES
pam_service_name=vsftpd.virtual
guest_enable=YES
user_sub_token=$USER
local_root=/var/ftp/users/$USER
chroot_local_user=YES
hide_ids=YES
xferlog_enable=YES
vsftpd_log_file=/var/log/vsftpd.log
log_ftp_protocol=YES
pasv_enable=Yes
pasv_max_port=21000
pasv_min_port=20000
# cat /etc/pam.d/vsftpd.virtual
#%PAM-1.0
auth       required     pam_userdb.so db=/etc/vsftpd/virtual_users
account    required     pam_userdb.so db=/etc/vsftpd/virtual_users
session    required     pam_loginuid.so
iptables -I INPUT 1 -p tcp --destination-port 20000:21000 -j ACCEPT
service iptables save
chown ftp.ftp /var/ftp/users/USERNAME/

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>