当前位置: 技术问答>linux和unix
求大神解答,iptables设置了无法用ftp工具连接
来源: 互联网 发布时间:2017-05-23
本文导语: Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTA BLISHED ACCEPT tcp -- 0.0....
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0 state RELATED,ESTA BLISHED
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:22
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3306
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:3690
ACCEPT all -- 127.0.0.1 127.0.0.1
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:20
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp dpt:21
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:22
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:80
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:3690
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:20
ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spt:21
上面就是我配置的iptables 但是无法用ftp工具连接,求帮助
|
1 你在vsftpd这台机器本机通过ftp localhost,能不能输入用户名和密码成功进入?
2 如果成功进入了,ls或者dir查看目录是成功还是失败
3 vsftpd是否开启被动模式,因为ftp的被动模式在tcp/ip三次握手时是21端口,但是当你显示server上的数据时,client会通过随机端口来连接server,但是server并没有开启这个随机端口,所以被动模式下把数据传输端口指定,如下pasv_enable=YES,pasv_min_port=1000,pasv_max_port=2000;类似的参数,并且iptables也要开启1000-2000的端口允许
2 如果成功进入了,ls或者dir查看目录是成功还是失败
3 vsftpd是否开启被动模式,因为ftp的被动模式在tcp/ip三次握手时是21端口,但是当你显示server上的数据时,client会通过随机端口来连接server,但是server并没有开启这个随机端口,所以被动模式下把数据传输端口指定,如下pasv_enable=YES,pasv_min_port=1000,pasv_max_port=2000;类似的参数,并且iptables也要开启1000-2000的端口允许
|
can't connect from localhost,
is vfstpd up? netstat -ntpl|grep 21
Make it work locally then you will have to set up iptable with ip_conntrack_ftp, tweak selinux options, set up password for virtual users......
btw, you have a very tight output rule on iptables (policy drop)...
is vfstpd up? netstat -ntpl|grep 21
Make it work locally then you will have to set up iptable with ip_conntrack_ftp, tweak selinux options, set up password for virtual users......
btw, you have a very tight output rule on iptables (policy drop)...