LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Firewalld command to block all outgoing connection to specific system user (https://www.linuxquestions.org/questions/linux-newbie-8/firewalld-command-to-block-all-outgoing-connection-to-specific-system-user-4175603982/)

roopakl 04-16-2017 11:23 PM

Firewalld command to block all outgoing connection to specific system user
 
Hi,

I can remember that I had done the same with iptables using
Code:

iptables -A OUTPUT -m owner --uid-owner <username> -j DROP
Since now I am using CentOS7 and it use firewalld and I don't know that how to block all internet access to specific user using firewall-cmd command.

Thanks in advance and expecting your kind help on this.

jpollard 04-17-2017 07:52 AM

You want either firewall-cmd or /usr/bin/firewall-config.

You can add such rules using one or the other to the permanent tables to get the same result.

I think it will have to be added under "custom rules".

roopakl 04-17-2017 07:58 AM

Hi jpollard,

Thanks for the reply. Would you please post firewall-cmd command for the same.

Appreciate your kind help.

jpollard 04-17-2017 05:17 PM

I haven't done it, but most of the specifications appear in

https://www.rootusers.com/how-to-use...ering-and-nat/

Sorry about not knowing the details of your specific rule.

roopakl 04-18-2017 12:06 AM

Hi jpollard,
Thanks for sharing link to learn FirewallD.
The link probably has all the info but except what I am expecting here.

So would you please let me know which firewall-cmd command is used to block all outgoing connection to specific system user?

Or if it is not possible with FirewallD then do I need remove FirewallD and install IPTables?

Expecting your kind suggestion.

jpollard 04-18-2017 05:04 AM

IPTables is what firewalld is using. If you disable firewalld you can use it directly.


All times are GMT -5. The time now is 02:21 AM.