Wednesday, October 31, 2007

Howto: Disable any Ubuntu users internet access

This is quite simple and very effective, I have used it a few times, its pretty convenient since it looks as if the internet is broke or something :)
Check it:

Simply:
sudo gedit /etc/network/interfaces
Then lets add the simple iptables rule to the interfaces file when the internet connection starts up...
Simply add this under auto wlan0 or auto eth0 in the interfaces file:
pre-up iptables -A OUTPUT -p tcp -m owner --uid-owner mykidsusername -j DROP
Ok now you can try it out:
type in the terminal:
sudo iptables -A OUTPUT -p tcp -m owner --uid-owner mykidsusername -j DROP
and switch users to the username you blocked and try to access the internet...
p00f there ya go
enjoy

2 comments:

  1. This should work with any linux distro.... You can also limit access to a bunch of things in ubuntu goto system>administration>users and groups. Highlight the username and click properties. Click the tab user privileges. You can make a person have access to cdroms, scanners, modems, floppy drives, audio output, system logs, modems,,, etc.etc. This is easier for a new user of linux to limit things for a child or a teacher in a class.

    ReplyDelete
  2. word, users and groups is good but unforunately you can only disable access to modem's and devices, having an option in there to limit internet access or have parental control's would be a great addition

    ReplyDelete