I teach in a school and have a cart of laptops that I set up with Edubuntu 12.04. I am using LanSchool to monitor their screens, remotely control them, blank their screens, etc. The functionality is limited however and website blocking has been incomplete and buggy for quite a while. I want to allow YouTube when students need to view something or even to listen to music while working for instance, but during testing or to refocus them I want to be able to block YouTube as quickly as possible. This works pretty well with LanSchool on Windows simply by clicking a button or two.
My school has a proxy server that blocks most of what I don't want students to access. However, I cannot quickly block and unblock sites during a class period on this proxy server since I have to send requests to another building and this takes hours or even days.
I can however run commands remotely through LanSchool and I also set up easy ssh access with keys. So what I need are commands that I can run to
- Block/unblock all websites
- Blacklist or block a set of sites
- Whitelist a set of sites
I have played around with iptables but have not been able to get it working. I suspect some of my issues are due to all traffic being routed through the proxy server and so any attempt to regulate traffic using iptables fails. We primarily use Google Chrome since we use Google Apps on a daily basis.
/etc/hosts
. If you specify a line that says127.0.0.1 youtube.com
, then the computer won't be able to accessyoutube.com
(note that, technically, Youtube videos don't come from that domain).