How can i block facebook for particular time intervals in Ubuntu server?
Can anyone help me.
How can i block facebook for particular time intervals in Ubuntu server?
Can anyone help me.
If you like to do it command line:
sudo iptables -A OUTPUT -p tcp --dport 80 -d ipaddress_here -m time --timestart 09:00 --timeend 22:00 -j ACCEPT
sudo iptables -A OUTPUT -p tcp --dport 80 -d ipaddress_here -j REJECT
Those are two rules for your iptable allow to use port 80 for specificIP in a specific time and reject in other times.
All you have is to replace the ip-address of facebook letus say and put the timestart and timeend
But this is great IF you know the IP's.
For that I provide you other ways:
If you use Google Chrome, I strongly recommend the StayFocusd extension. It takes a second to install and 30 seconds to configure the options - choose how much time you want to allow yourself to be on Facebook and other sites that you class as time-wasting.
If you're a Firefox user, consider LeechBlock.