设为首页 - 加入收藏 ASP站长网(Aspzz.Cn)- 科技、建站、经验、云计算、5G、大数据,站长网!
热搜: 手机 数据 公司
当前位置: 首页 > 服务器 > 安全 > 正文

VSftpd安装和配置FTP虚拟用户实践(5)

发布时间:2021-01-08 15:10 所属栏目:53 来源:网络整理
导读:/etc/hosts.allow ## hosts.allow This file describes the names of the hosts which are# allowed to use the local INET services,as decided# by the ‘/usr/sbin/tcpd’ server.#vsftpd: 123.103.47.0/255.255

/etc/hosts.allow

#
# hosts.allow This file describes the names of the hosts which are
# allowed to use the local INET services,as decided
# by the ‘/usr/sbin/tcpd’ server.
#
vsftpd: 123.103.47.0/255.255.255.0 218.240.63.0/255.255.255.0 59.46.172.0/255.255.255.0 10.0.0.0/255.0.0.0 60.2.80.0/255.255.255.0 218.249.230.0/255.255.255.0 160.10.0.0/255.255.0.0 218.246.69.0/255.255.255.0 125.35.3.0/255.255.255.0 : allow

/etc/hosts.deny

#
# hosts.deny This file describes the names of the hosts which are
# *not* allowed to use the local INET services,as decided
# by the ‘/usr/sbin/tcpd’ server.
#
# The portmap line is redundant,but it is left to remind you that
# the new secure portmap uses hosts.deny and hosts.allow. In particular
# you should know that NFS uses portmap!
vsftpd : ALL : DENY

将tcp_wrappers=yes添加至/etc/vsftpd/vsftpd.conf

$ vi /etc/vsftpd/vsftpd.conf
tcp_wrappers=YES

重新启动VSftpd

$ service vsftpd restart
Shutting down vsftpd: OK ]
Starting vsftpd for vsftpd: OK ]

故障排除

如果配置中出现问题,请从以下几方面检查

  • 文件权限和文件属主问题
  • 防火墙iptables没开放相关的端口
  • SELinux导致的权限问题,建议先关闭SELinux再配置VSftp,之后再开启到permissive模式.或者运行这条命令:setsebool -P ftp_home_dir=1 .

参考文档

http://www.google.com
http://www.ha97.com/4113.html
http://www.cnblogs.com/sztsian/archive/2011/08/23/2204102.html

文:Mike

文章出处:运维之美(微信公众号ID:Hi-Linux)

(编辑:ASP站长网)

网友评论
推荐文章
    热点阅读