iptables - allow yum update port 80 but deny browsing

General support questions including new installations
Post Reply
joshroden
Posts: 9
Joined: 2011/03/29 14:58:30

iptables - allow yum update port 80 but deny browsing

Post by joshroden » 2016/03/14 16:00:06

Anyone know how to allow yum updates but to deny all other browsing on ports 80 and 443?
Thanks

gerald_clark
Posts: 10642
Joined: 2005/08/05 15:19:54
Location: Northern Illinois, USA

Re: iptables - allow yum update port 80 but deny browsing

Post by gerald_clark » 2016/03/14 16:50:59

Don't install a browser.

User avatar
TrevorH
Site Admin
Posts: 33219
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: iptables - allow yum update port 80 but deny browsing

Post by TrevorH » 2016/03/14 16:56:24

Since yum has to run as root you can use the -m owner --uid-owner 0 iptables parameters to only allow outbound connection on ports 80/443.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

joshroden
Posts: 9
Joined: 2011/03/29 14:58:30

Re: iptables - allow yum update port 80 but deny browsing

Post by joshroden » 2016/03/17 11:32:22

Hi TrevorH
Your suggestion worked great!
Thx

joshroden
Posts: 9
Joined: 2011/03/29 14:58:30

Re: iptables - allow yum update port 80 but deny browsing

Post by joshroden » 2016/03/24 08:38:58

Hi,
Is there an iptables way to allow access only to gmail.com, eventhough, there's a lot of
ip addresses belonging to gmail.com and often changing as well?
I would like to get a referal to a free course on iptables?
thx

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

Re: iptables - allow yum update port 80 but deny browsing

Post by giulix63 » 2016/03/24 08:49:44

Use a filtering proxy, e.g. Squid.
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.

Post Reply