LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-16-2017, 11:23 PM   #1
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Rep: Reputation: Disabled
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.

Last edited by roopakl; 04-18-2017 at 12:08 AM.
 
Old 04-17-2017, 07:52 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,842

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
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".
 
Old 04-17-2017, 07:58 AM   #3
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Original Poster
Rep: Reputation: Disabled
Hi jpollard,

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

Appreciate your kind help.
 
Old 04-17-2017, 05:17 PM   #4
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,842

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
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.
 
Old 04-18-2017, 12:06 AM   #5
roopakl
Member
 
Registered: Sep 2011
Posts: 95

Original Poster
Rep: Reputation: Disabled
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.
 
Old 04-18-2017, 05:04 AM   #6
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,842

Rep: Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472Reputation: 1472
IPTables is what firewalld is using. If you disable firewalld you can use it directly.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to block almost all outgoing traffic (except VPN) from a specific IP in my router Dannermax Linux - Networking 3 05-09-2015 02:05 PM
[SOLVED] Block outgoing for particular user at particular time using iptables nitya Linux - Newbie 9 02-21-2013 08:11 PM
Block outgoing mail for specific users austin001 Linux - Server 2 02-27-2012 03:51 PM
Iptables/Guarddog - how to block specific outgoing packets craftybytes Linux - Security 7 05-19-2006 12:26 AM
How to hide and block a directory for a specific user hoolie_v Linux - Newbie 2 08-08-2004 07:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration