AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 804209
Accepted
King David
King David
Asked: 2016-09-21 04:22:16 +0800 CST2016-09-21 04:22:16 +0800 CST 2016-09-21 04:22:16 +0800 CST

安装/升级 iptables rpm 后,从 chkconfig 开启 iptables

  • 772

为什么从头开始安装 iptables 或升级 iptables

然后 chkconfig 中的 iptables 显示在 ?

安装/升级 iptables 后如何避免 chkconfig iptables on ?

  • 备注我们要避免在安装 iptables 后执行chkconfig iptables off

我的redhat机器版本6的真实例子

service iptables status
Firewall is stopped. 

# chkconfig --list | grep iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off

# chkconfig iptables off

# chkconfig --list | grep iptables
iptables        0:off   1:off   2:off   3:off   4:off   5:off   6:off



yum remove iptables
.
.
.


chkconfig --list | grep iptables

show nothing ( as should be )



yum install  iptables
.
.
.

成功安装 iptables 后,我们可以看到 chkconfig 已打开 - 为什么?

# chkconfig --list | grep iptables
iptables        0:off   1:off   2:on    3:on    4:on    5:on    6:off

这样做的关键问题是:

重启后 iptables 服务将运行,我们希望避免这种情况

请告知如何在安装 iptables 包后避免 iptables chkconfig on

linux redhat iptables chkconfig
  • 2 2 个回答
  • 639 Views

2 个回答

  • Voted
  1. Best Answer
    HBruijn
    2016-09-21T05:03:52+08:002016-09-21T05:03:52+08:00

    您对为什么启用 iptables 服务的问题很容易回答:

    rpm -q --scripts iptables
    
    ...
    postinstall scriptlet (using /bin/sh):
       /sbin/ldconfig
       /sbin/chkconfig --add iptables
    

    RPM 包中包含的安装后脚本调用 chkconfig 来启用该服务。

    Yum 没有提供不运行安装后脚本的选项,但rpm会在手动安装之前下载 rpm。

    yumdownloader iptables
    rpm -i --noscripts iptables.x86_64.x.y-z.rpm
    
    • 1
  2. Thomas
    2016-09-21T06:46:59+08:002016-09-21T06:46:59+08:00

    好吧,如果您无法控制 RPM 保持重新启用服务的行为,您应该进行配置iptables以满足您的需求。

    最简单的方法是在/etc/sysconfig/iptables. 这不会加载任何规则,应该等于不运行。
    只是移动或删除它不是解决方案,因为该文件将iptables-services在更新或重新安装时安装。

    • 1

相关问题

  • 多操作系统环境的首选电子邮件客户端

  • 你最喜欢的 Linux 发行版是什么?[关闭]

  • 更改 PHP 的默认配置设置?

  • 保护新的 Ubuntu 服务器 [关闭]

  • (软)Ubuntu 7.10 上的 RAID 6,我应该迁移到 8.10 吗?

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve