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
    • 最新
    • 标签
主页 / user-106483

Florian Heigl's questions

Martin Hope
Florian Heigl
Asked: 2015-05-12 03:43:08 +0800 CST

如何在 CentOS kickstart 中结合防火墙 --enabled 和 --nobase?

  • 3

作为系统强化的一部分,我尝试在 CentOS 6.6 kickstart 期间使用以下行配置我的防火墙。它在一种情况下确实有效,否则无效。

启动防火墙

firewall --enabled 
         --service=ssh --service=http --service=https
         --port=53:udp,69:udp,25150:tcp,25151:tcp,3306:tcp

这告诉它启用防火墙,并打开一组特定的服务。换行符是为了可读性,而不是配置的一部分。

我的包部分在下面,请注意:如果我添加 --nobase选项,iptables 处于直通模式,没有配置痕迹。

一旦我删除 --nobase,iptables 设置正确,只有定义的开放端口集。

启动包:

#%packages --nobase --excludedocs
%packages --excludedocs
@core
yum
wget
openssh-server
yum-downloadonly
screen
sysstat
lsscsi
ntpdate
rudder-agent
-nano
-selinux-policy
-selinux-policy-targeted

我做了很多重新安装来追踪这个问题,并通过谷歌搜索发现有很多人结合 --nobase 和防火墙 --enabled --port设置。

另外,仅供参考:将 iptables 添加到包列表中并没有产生差异。- 它是自动添加的。

如果您想知道,最终应用程序的软件供应商不允许启用 SELinux。

防火墙输出 1

这是添加基础时的输出:

[host]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED 
ACCEPT     icmp --  anywhere             anywhere            
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:ssh 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:http 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:https 
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:domain 
ACCEPT     udp  --  anywhere             anywhere            state NEW udp dpt:tftp 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:25150 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:25151 
ACCEPT     tcp  --  anywhere             anywhere            state NEW tcp dpt:mysql 
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  anywhere             anywhere            reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

防火墙输出 2

这是我使用 --nobase 的时候:

[host]# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

问题:

  • 我不知道其他人是否没有检查,或者这是特定于 CentOS 6.6 的错误或确切的触发参数是什么。
  • @base 中的哪些软件包在安装过程中可能与 iptables 配置有关?

是的,基本上,我只想填补缺失的依赖。如果找不到它,我会将 iptables 配置置于操作系统安装之外的某些东西的控制之下。我想避免这种情况,以便防火墙配置在首次启动时就位并由默认机制生成,而不是某些插件。

centos
  • 1 个回答
  • 1381 Views

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