userlist_enable=YES
userlist_deny=NO
vi /etc/vsftpd/user_list
注释所有帐户,添加ftpuser
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
#root
#bin
#daemon
#adm
#lp
#sync
#shutdown
#halt
#mail
#news
#uucp
#operator
#games
#nobody
ftpuser
配置到这里,就可以远程用FTP客户端登录并上传文件,文件会保存在ftpuser的主目录,也就是/home/ftp。
3. 不允许FTP下载
vi /etc/vsftpd/vsftpd.conf
yum -y install tcp_wrappers
4.2 检查tcp_wrappers是否被设置为YES
vi /etc/vsftpd/vsftpd.conf
tcp_wrappers=YES
4.3 添回允许的IP
vi /etc/hosts.allow
vsftpd:允许的IP地址
4.4 拒绝所有其他的IP
vi /etc/hosts.deny
vsftpd:ALL
5.如果出现报530错误。
1.密码设置的有点问题。
2.打开
vi /etc/pam.d/vsftpd,注释一下
#auth required pam_listfile.so item=user sense=deny file=/etc/vsftpd/ftpusers onerr=succeed
参考资料:
CentOS 6.2 ftp 配置
vsftpd 配置文件详细说明
This is the example for Access Control by TCP Wrapper