1

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

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

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

4

2 回答 2

2

This is an old question; however, I think this would be useful to share.

When you create a service, a <service-name>.xml file will be created at /etc/firewalld/services/

Now, when you delete a custom service, make sure you delete the corresponding file(s) - as there may be a .xml.old file for that service - too.

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

Check to see if your service is still available or not:

firewall-cmd --info-service=ssh2

This should return an error. :)

于 2018-09-06T09:34:20.623 回答
2

我建议:

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

请参阅:http ://www.firewalld.org/documentation/man-pages/firewall-cmd.html

于 2017-04-19T19:51:50.667 回答