Note: vsftpd configuration for local users based on nginx virtual FTP users.
After yum install vsftpd:
Clear vsftpd. conf and write the following content:
Listen = YES
Ftpd_banner = Technical-Support: QQ: 252872160 Email: root@upall.cn
Anonymous_enable = NO
Local_enable = YES
Local_umask = 022
Guest_enable = YES
Guest_username = nginx
Userlist_enable = YES
User_config_dir =/etc/vsftpd/vusers
Dirmessage_enable = YES
Xferlog_enable = YES
Xferlog_std_format = YES
Pam_service_name = vsftpd
Connect_from_port_20 = YES
Tcp_wrappers = YES
Pasv_enable = YES
Pasv_min_port = 5000
Pasvanderbilt max_port = 5500
FTP account permission. The file name is an FTP account:/etc/vsftpd/vusers/ftpUser
Local_root =/data/web/ftpUser
Anon_umask = 077
Write_enable = YES
Anon_world_readable_only = NO
Anon_upload_enable = YES
Anon_mkdir_write_enable = YES
Anon_other_write_enable = YES
FTP account:/etc/vsftpd/vusers.txt
FtpUser
FtpPassword
Script used to add an FTP account:/etc/vsftpd/makeFtpDb. sh
#! /Bin/bash
Db_load-T-t hash-f/etc/vsftpd/vusers.txt/etc/vsftpd/vusers. db
Chmod 600/etc/vsftpd/vusers. db
./MakeFtpDb. sh will generate vusers. db after execution
Add all comments and add only the following two rows:/etc/pam. d/vsftpd
##% PAM-1.0
# Session optional pam_keyinit.so force revoke
# Auth required pam_listfile.so item = user sense = deny file =/etc/vsftpd
# Auth required pam_shells.so
# Auth include password-auth
# Account include password-auth
# Session required pam_loginuid.so
# Session include password-auth
Auth required/lib/security/pam_userdb.so db =/etc/vsftpd/vusers
Account required/lib/security/pam_userdb.so db =/etc/vsftpd/vusers