当前位置:首页 » 操作系统 » linux防火墙端口关闭

linux防火墙端口关闭

发布时间: 2025-01-02 09:18:29

linux端口被防火墙关闭如何打开吗

1) 重启后生效

开启: chkconfig iptables on

关闭: chkconfig iptables off

2) 即时生效,重启后失效

开启: service iptables start

关闭: service iptables stop

需要说明的是对于Linux下的其它服务都可以用以上命令执行开启和关闭操作。

在开启了防火墙时,做如下设置,开启相关端口,

修改/etc/sysconfig/iptables 文件,添加以下内容:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT

重起iptalbes服务:service iptables restart

❷ 如何关闭linux防火墙的443端口

1、首先需要在Linux终端输入指令:iptables -I INPUT -p tcp --dport 443 -j ACCEPT。

❸ linux如何关闭防火墙

关闭防火墙,就可以外部访问了。不受端口限制。生产环境,最好开启防火墙,开启部分端口。
1.永久有效
开启: chkconfig iptables on 关闭: chkconfig iptables off

2.即刻生效
开启: service iptables start 关闭: service iptables stop

3.开启部分端口
vim /etc/sysconfig/iptables

添加想要开启的相关端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 6379 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8081 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 8082 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
service iptables restart

更多详细Linux知识可参考《Linux就该这么学》。

热点内容
办公室如何做数据服务器 发布:2025-07-13 15:55:24 浏览:327
用一句话证明我很穷ftp 发布:2025-07-13 15:54:48 浏览:936
安卓如何启动画面 发布:2025-07-13 15:43:22 浏览:643
安卓哪个娃娃 发布:2025-07-13 15:35:52 浏览:142
服务器列表格式错误什么意思 发布:2025-07-13 15:33:05 浏览:170
lol脚本有哪些 发布:2025-07-13 15:10:28 浏览:165
lol怎么上传囧图 发布:2025-07-13 15:09:40 浏览:89
c语言火车售票系统 发布:2025-07-13 15:06:55 浏览:391
用什么缓存视频 发布:2025-07-13 14:52:27 浏览:360
GTA5mods文件夹 发布:2025-07-13 14:52:27 浏览:53