vsftpd搭建中的关键配置

mkdir -p /var/www
useradd -d /var/www/ftp -s /sbin/nologin <ftpuser>
chmod -R 755 /var/www/ftp
passwd <ftpuser>
echo "/sbin/nologin" >> /etc/shells

/etc/vsftpd/vsftpd.conf

anonymous_enable=NO
local_enable=YES
local_root=<website_root_dir>
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
listen_ipv6=YES
pam_service_name=vsftpd
userlist_enable=NO
userlist_deny=NO
tcp_wrappers=YES
# userlist_file=/etc/vsftpd/user_list
pasv_enable=Yes
pasv_max_port=20000
pasv_min_port=21000