网站首页 美容 美体 服饰 情感 娱乐 生活
当前位置:秀秀馆 > 生活 > 经验

linux防火墙设置 不妨操作一下

栏目: 经验 / 发布于: / 人气:1.94W
linux防火墙设置 不妨操作一下

1、首先需要在Linux系统中查找并打开文件以编辑和配置防火墙,执行命令: vi /etc/sysconfig/iptables。

2、然后将以下语句添加到上面打开的文件中:-A INPUT -m state -state NEW -m tcp -p tcp -dport 80 -j ACCEPT(允许端口80通过防火墙,这里以端口80为例)。

3、配置防火墙规则# Manual customization of this file is not recommended.

4、重启防火墙,使配置生效。/etc/init.d/iptables restart或者service iptables restart