问题
- linux 客户端登陆FTP胜利后 呈现ls卡死问题,然而windows应用FileZilla客户端失常。
- 代码如下
331 Please specify the password.Password:230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp> ls227 Entering Passive Mode (172,41,38,5,234,120).^Creceive abortedwaiting for remote to finish abort
剖析
- 从上述能够看出,输出ls命令之后,ftp进入被动模式,
而后前面一串数字(172,41,38,5,234,120),是ftp服务器返回的ip 与端口。 - 前四位示意ip,最初两位是端口,端口示意规定为234*256+120=60024,所以服务器返回的是172.41.38.5:60024。
显著是个内网IP,此时应该判断客户端是否拜访到这个内网IP。上述例子是拜访不到。
解决
- 批改 ftp服务器配置/etc/vsftpd/vsftpd.conf
listen=YESlisten_ipv6=NOpasv_address=公网IP
- 重启失效
service vsftpd restart
参考链接 :
[记一次 ftp 能够失常登录,然而输出ls dir 命令卡死的问题
](https://blog.csdn.net/qq_3878...)