linux下关闭开启防火墙命令

来源:互联网 发布:js钉钉日期 编辑:程序博客网 时间:2024/05/04 13:35
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
<script>window._bd_share_config={"common":{"bdSnsKey":{},"bdText":"","bdMini":"2","bdMiniList":false,"bdPic":"","bdStyle":"0","bdSize":"16"},"share":{}};with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion='+~(-new Date()/36e5)];</script>
阅读(854) | 评论(1) | 转发(0) |
0

上一篇:rand函数和random函数的区别

下一篇:C语言中枚举类型的使用

相关热门文章
  • strongswan 生成证书命令...
  • 在uboot中添加自己的命令...
  • gcc编译时有卡住的现象,cc1占...
  • python subprocess Popen
  • centos 7 环境搭建
  • linux 常见服务端口
  • xmanager 2.0 for linux配置
  • 【ROOTFS搭建】busybox的httpd...
  • openwrt中luci学习笔记
  • 什么是shell
  • linux dhcp peizhi roc
  • 关于Unix文件的软链接
  • 求教这个命令什么意思,我是新...
  • sed -e "/grep/d" 是什么意思...
  • 谁能够帮我解决LINUX 2.6 10...
给主人留下些什么吧!~~

刘一痕2010-03-29 18:40:53

关闭selinux的方法是,修改配置文件:/etc/selinux/config 将其中的选项selinux设置为disabled即可

回复 | 举报