【问题标题】:firewalld, removing custom created service / linuxfirewalld,删除自定义创建的服务/linux
【发布时间】:2017-04-19 19:47:58
【问题描述】:

我正在通过命令添加新的自定义服务

firewall-cmd --permanent --new-service=ssh2

但找不到如何删除它...

【问题讨论】:

    标签: bash firewalld


    【解决方案1】:

    我建议:

    firewall-cmd --permanent --remove-service=ssh2
    

    见:http://www.firewalld.org/documentation/man-pages/firewall-cmd.html

    【讨论】:

    • 不,它不起作用,删除那种方式后,然后 cmd --zone=public --permanent --remove-service=ssh2 并重新加载firewalld,并添加具有相同名称的服务,获取:错误:NAME_CONFLICT:new_service():'ssh2'
    【解决方案2】:

    这是一个老问题;但是,我认为这将是有用的分享。

    创建服务时,<service-name>.xml 文件将在/etc/firewalld/services/ 创建

    现在,当您删除自定义服务时,请确保删除相应的文件 - 因为该服务可能还有一个 .xml.old 文件。

    firewall-cmd --permamnent --remove-service=ssh2
    rm -f /etc/firewalld/services/ssh2.xml*
    firewall-cmd --reload
    

    检查您的服务是否仍然可用:

    firewall-cmd --info-service=ssh2
    

    这应该返回一个错误。 :)

    【讨论】:

      猜你喜欢
      • 2019-12-15
      • 1970-01-01
      • 1970-01-01
      • 2014-03-15
      • 2020-10-02
      • 1970-01-01
      • 2021-09-28
      • 2017-02-18
      • 1970-01-01
      相关资源
      最近更新 更多