CentOS6中连接ftp服务器下载文件时出现了java.net.SocketException: Connection reset

论坛 期权论坛 脚本     
匿名技术用户   2021-1-5 08:51   21   0

问题描述:连接CentOS6中的ftp服务器下载文件时出现了java.net.SocketException: Connection reset

解决办法:

1.查看防火墙状态,发现防火墙已开启

service iptables status

2.查看规则列表

iptables --list-rules

3.使用编辑vi命令打开系统防火墙配置文件并编辑规则

vim /etc/sysconfig/iptables
--开放22001端口
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22001 -j ACCEPT

4.保存并重启防火墙

service iptables restart

5.再次查看规则,会发现刚刚添加的对外开放的端口已成功配置到该规则中,上述问题已解决

iptables --list-rules

补充扩展:

永久关闭防火墙:chkconfig iptables off

两个命令同时运行,运行完成后查看防火墙关闭状态
service iptables status

1 关闭防火墙-----service iptables stop 
2 启动防火墙-----service iptables start 
3 重启防火墙-----service iptables restart 
4 查看防火墙状态--service iptables status 
5 永久关闭防火墙--chkconfig iptables off 
6 永久关闭后启用--chkconfig iptables on

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP