Ubuntu – How to Permanently Disable Internet Access

Ubuntu

I have to find a way to finish a horribly boring thesis and I'm a huge procrastinator and easily distracted. A very useful trick was going to the library with an old laptop of mine with Ubuntu 11.04, where I removed the "network-manager" and "network-manager-gnome" packages to disable the internet connection.

Unfortunately I figured out a quick way to reinstall them and now the "magic" is gone. So my question is: Do you know any other way to completely remove the ability to connect to the internet under Ubuntu 11.04? Perhaps by blocking the ability to install new packages?

Since this is in a way a fight against myself, solutions that deal with permissions etc. won't really work, since I know the su password 🙂 I would really appreciate any help!

Best Answer

While I agree with everyone that this is really a pretty non technical question, I thought I would throw in my two cents anyways. Depending how much effort you really want to go to in order to do this and how recoverable you want it to be, the quickest and easiest to recover mode I can think of is run the following command

sudo iptables -I INPUT 1 -j DROP

If you want to get a little more serious, about it and much harder to fix, find your kernel modules for each NIC or just the NIC's you want to disable and delete them then either rmmod them or reboot the system. You can find the name name of the module by running

ethtool -l eth0

and replacing eth0 with all the NIC's you don't want active. Then to find the kernel modules, let's say in your case your find the driver is e1000e, then run

find /lib/modules/ -iname e1000e | grep '\/kernel\/drivers\/net\/'

That should give you a pretty good view of where the drivers are from there you can delete them if you want though to recover you would need to copy them back from either a package or another backup you made and put them back to where they should be. If for some reason I wanted to disable my NIC in a way that would make sure I couldn't enable it while I was out then I would copy them to a USB fob and leave the fob at home.

Anyways, this is all hypothetical. If you really want to make sure you don't use the net when you shouldn't then you will need to learn to exercise self restraint and personal discipline.

P.S.: If you want to make sure the laptop doesn't access the net again, open it up. If it is a laptop with a WiFi NIC in a mini PCI port then pop it out and throw it away. If it uses an onboard chip for WiFi that is a dedicated chip / it isn't part of the North bridge or South bridge and doesn't provide any other functionality then WiFi then de-solder it and throw it away. If it has WiFi built into a shared chip set then either see if you can disable it in BIOS and have someone else set a BIOS administrator password so you can't change it or just sell the computer and buy one that doesn't have integrated WiFi then go buy some self help books on Getting Things Done and other motivation guides for accomplishing tasks.

Related Question