Where is the file location for the port?

Support for security such as Firewalls and securing linux
Post Reply
zhshqzyc
Posts: 8
Joined: 2016/03/21 15:55:09

Where is the file location for the port?

Post by zhshqzyc » 2016/03/22 15:51:19

Yesterday I added a port by

Code: Select all

firewall-cmd --permanent --add-port=5004/tcp
Where is the configuration file because I want to double check it and remove it probably.

giulix63
Posts: 1305
Joined: 2014/05/14 10:06:37
Location: GMT

Re: Where is the file location for the port?

Post by giulix63 » 2016/03/22 16:00:13

You may want to use --remove-port as all of firewalld configuration is stored in XML files in /etc/firewalld/...
Root is evil: Do not use root (sudo) to run any of the commands specified in my posts unless explicitly indicated. Please, provide the necessary amount of context to understand your problem/question.

aks
Posts: 2910
Joined: 2014/09/20 11:22:14

Re: Where is the file location for the port?

Post by aks » 2016/03/22 17:02:08

You're better off using "supported" interfaces (in this case firewall-cmd) than manually editing configuration files. You can quite easily cock it up and run the risk of SELinux mis-labelling etc...

zhshqzyc
Posts: 8
Joined: 2016/03/21 15:55:09

Re: Where is the file location for the port?

Post by zhshqzyc » 2016/03/22 17:14:11

So what xml file? I still can't locate it in /etc/firewalld. There is a lockdown-whitelist.xml file, but it doesn't have the information.

aks
Posts: 2910
Joined: 2014/09/20 11:22:14

Re: Where is the file location for the port?

Post by aks » 2016/03/22 17:36:55

I just told you not to do that!
/etc/firewalld/zones/<zone_name>.xml
services defined in: /etc/firewalld/services/*

zhshqzyc
Posts: 8
Joined: 2016/03/21 15:55:09

Re: Where is the file location for the port?

Post by zhshqzyc » 2016/03/22 17:41:32

What "supported interface" do you recommend?

aks
Posts: 2910
Joined: 2014/09/20 11:22:14

Re: Where is the file location for the port?

Post by aks » 2016/03/23 16:37:06

firewall-cmd

Post Reply

Return to “CentOS 7 - Security Support”