FTP时显示500 Illegal PORT command的解决

缘由

由于过年期间,大家都在外地,临时需要登录FTP,特别2020年面临肺炎事件,大部分员工都在家办公了。但是非常奇怪的是 一直出现如下 错误

ftp> ls
500 Illegal PORT command.
ftp: bind: Address already in use
ftp>
ftp> dir
500 Illegal PORT command.


解决方案

我开始还以为是网络问题,但是测试各种情况,都不行。然后就上网查看了相关资料发现是防火墙设置的问题。通过如下解决问题

局域网用FTP命令访问外网的FTP SERVER,执行任何命令(如dir,ls,put,get)总是报下面的错误
ftp:500 Illegal PORT command. 425
ftp:Use PORT or PASV first
或者是下面的错误
ftp:500 Illegal PORT command.
ftp: bind: Address already in use
主要是由于Iptables防火墙不支持
ip_nat_ftp
ip_conntrack_ftp
在linux的ftp服务器上执行下列命令即可解决
modprobe ip_nat_ftp
modprobe ip_conntrack_ftp


通过执行如上两条命令,并使用主动模式 就解决了


600