centos7上建立vsftp服务,构建图片服务器各种异常

端口开启方式:

centos7下跟旧版本有些不同:
firewall-cmd –zone=public –add-port=20/tcp –permanent
firewall-cmd –zone=public –add-port=21/tcp –permanent
firewall-cmd –zone=public –add-port=22/tcp –permanent
firewall-cmd –zone=public –add-port=30000-35000/tcp –permanent
重启防火墙:
systemctl restart firewalld.service

在Java代码中构建ftp上传中可增加:

ftp.addProtocolCommandListener(new PrintCommandListener(new PrintWriter(System.out)));

查看各种上传状态:

CWD /home/ftpuser/ftp/images
250 Directory successfully changed.
TYPE
200 Switching to Binary mode.
PORT 192,168,0,7,22,31
200 PORT command successful. Consider using PASV.
STOR 3.jpg
425 Failed to> establish connection.

以上错误需要在上传设置时:ftp.enterLocalPassiveMode();

Java FTP 报错 :Permission denied: recv failed 关闭本机防火墙解决

FTP上传成功返回:553 Could not create file 上传者用户对目标文件夹的权限设置

你可能感兴趣的:(linux,ftp)