Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

how to block a user from accessing internet in linux.

Is the following command correct.

iptables -A OUTPUT -p tcp --dport 80,443 -m owner --uid-owner $USERNAME -j DROP
share|improve this question

migrated from stackoverflow.com Nov 29 '09 at 23:17

This question came from our site for professional and enthusiast programmers.

4  
should be on superuser.. –  opc Nov 28 '09 at 11:20
    
yes .. I have the super user permissions, I want restrict internet access to some users for sometime. –  Santhosh S Nov 28 '09 at 13:10
    
superuser.com instead of stackoverflow.com –  bmargulies Nov 28 '09 at 13:27
add comment

2 Answers

up vote 1 down vote accepted

I think that blocking http and https ports is not enough, however a user can use proxies or socks to by pass this restriction or may be some kinds of VPN.

The right way is to block all access to your users and permit all ports you need users to access.

share|improve this answer
add comment

there are some many other back-door ports that can be used besides 80 & 443... you should be using the "on network" vs "off network" strategy: block access to the IPs not part of the home LAN instead. I am not sure how to express this using iptables... I would have to google-it and so can you :-)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.