Block Internet access, but not network access for a user

firewallnetworking

Hi I would like to block one user on all of the linux machines (Debian Wheezy) from being able to surf the internet, chat and email. However they are using linux based Rip stations for large format printers so they need to be able to access everything on the local network. They do not, however need to access any thing outside of the local network.

Best Answer

Use iptables rule to block outbound traffic for a specific user:

http://www.cyberciti.biz/tips/block-outgoing-network-access-for-a-single-user-from-my-server-using-iptables.html

This way you even have full control over ranges of ips that get through (for instance, only allow LAN address block). It's probably useful also to block only specific ports. However... if you allow ssh, a savvy user will set up a tunnel and get out of the firewall. If you allow ssh to local machines, this firewall will have to be set up on all machines the user can access, otherwise, you can just tunnel to the nearest unrestricted machine and access the web from there.

It all depends on what kind of users you have. If the user must be able to use ssh, and you really want to block him out, then you have a problem. If it's meant for non-tech users without ssh knowledge, just block all outbound traffic and close ssh ports.

Related Question