Limiting web navigation in a period of time

Questions about software.
User avatar
escolar
Posts: 135
Joined: 23 Aug 2013 08:14
Location: Spain

Limiting web navigation in a period of time

Postby escolar » 10 Jan 2017 16:45

I'd like to limit the web navigation to some minutes every day or to a beginning and finishing times.
I have read Squid do it, but it seems a big application with not easy configuration.
My objective is to limit the time my child is watching Youtube videos.

Any idea?

User avatar
ilu
Posts: 2679
Joined: 09 Oct 2013 12:45

Re: Limiting web navigation in a period of time

Postby ilu » 10 Jan 2017 17:12

Oh, interesting - do you want to only limit youtube time or pc time in general? What do you want to happen when the time is up? Program termination, logout, shutdown? Do you want to count minutes or absolute time like ... end everything at 6pm? Or a combination?
One problem with youtube and web is that you can use different programs to watch it depending on which browsers you have installed. And children quickly find other interesting things to do with a computer - so maybe logout would be best?

User avatar
escolar
Posts: 135
Joined: 23 Aug 2013 08:14
Location: Spain

Re: Limiting web navigation in a period of time

Postby escolar » 10 Jan 2017 17:34

In this moment is enough to limit youtube, although a configurable tool to limit more webs would be welcome.
When the time of navigation be end would be enough a message in the browser "there is not possible connect with this web", or similar

User avatar
Zill
Posts: 1850
Joined: 13 Aug 2013 14:28
Location: Lincolnshire, UK

Re: Limiting web navigation in a period of time

Postby Zill » 10 Jan 2017 21:27

This kind of blocking is very difficult to implement at computer and/or OS level as there are so many ways to get around it! It doesn't take long before the kids know more than their parents about IT and so they soon, with the help of their friends, find all the workarounds. ;-)

Probably the best way to block unsuitable sites is by using an alternative DNS service, such as OpenDNS. However, my understanding is that blocking cannot be turned on and off at specific times - sites are blocked continuously.

If scheduled blocking is required then I suggest a router that has parental controls built-in is probably the best bet, such as some Netgear models.

However, even these can be circumvented if the child has 3G/4G access directly on their machine as, in this case, they don't need to use the WiFi/ethernet internet access provided by the protected router!

User avatar
ilu
Posts: 2679
Joined: 09 Oct 2013 12:45

Re: Limiting web navigation in a period of time

Postby ilu » 11 Jan 2017 01:17

You'll have to decide where to build the "wall" when the time is up.

1. Website level: block Youtube. This was probably what you thought about but this will not work, as Zill said.

2. Application level: block Firefox/Chrome. Probably possible if there aren't any other browsers ... don't know.

3. Connection level: block complete internet access - as Zill said, achieved best by buying a router with user profiles. Routers from AVM can assign profiles to every machine connected to the internal network. Easy and comfortable, others I don't know.

4. Automatic logout: This is what I would be interested in so I looked into it.
http://askubuntu.com/questions/68918/ho ... uting-time has some suggestions: configuring pam_time module or using one of the scripts proposed there. There is also Timekpr but it's distributed via ppa and those are Ubuntu only. It might still work but you'd need a deb package adapted for debian (which I could not find).
The kidtimer scripts look interesting (https://github.com/JimDunphy/kidtimer or one of the newer forks) - I really like the developers attitude to encourage his daughter to learn how to beat the script. My son easily outmaneuvers MSWin tasks, but thats just clicking, no real challenge there.

Has anybody ever used a script for timed logout or shutdown and, if yes, which one?

kurotsugi
Posts: 2267
Joined: 09 Jan 2014 00:17

Re: Limiting web navigation in a period of time

Postby kurotsugi » 11 Jan 2017 04:39

you can do it many ways.
- cut the internet connection
- block the port
- use a dns then after several minute block that dns
- use a firewall to forbid all access
- kill the browser
- use a vpn then disconnect it
- etc

User avatar
escolar
Posts: 135
Joined: 23 Aug 2013 08:14
Location: Spain

Re: Limiting web navigation in a period of time

Postby escolar » 11 Jan 2017 21:14

Thanks for your answers

I have write this script

Code: Select all

#! /bin/bash
hora=`date +%H` 
if [ $hora -eq 18 ] && [ -f "/etc/mifirewall/hosts.permitir" ] ; 
then 
 mv /etc/hosts /etc/mifirewall/hosts.denegar
 mv /etc/mifirewall/hosts.permitir /etc/hosts
 killall firefox-esr
elif [ $hora -ne 18 ] && [ -f "/etc/mifirewall/hosts.denegar" ] ;
then
 mv /etc/hosts /etc/mifirewall/hosts.permitir
 mv /etc/mifirewall/hosts.denegar /etc/hosts
 killall firefox-esr
fi 
echo "ejecutado"
it permits connect to Youtube between 18:00 and 18:59

hosts.permitir is the original /etc/hosts
hosts.denegar adds the line

Code: Select all

0.0.0.0 www.youtube.com
to /etc/hosts

The principal problem of this script is that it kills firefox when block youtube, but I seems to work

User avatar
xendistar
Posts: 515
Joined: 08 Jun 2014 08:17
Location: Bournemouth, UK

Re: Limiting web navigation in a period of time

Postby xendistar » 11 Jan 2017 22:45

Check your router as some routers have time schedules certain setting (wifi and DHCP) . You can then schedule a complete block on web access to that PC either by turning the wifi off (if they connect via Wifi) or via DHCP.

User avatar
escolar
Posts: 135
Joined: 23 Aug 2013 08:14
Location: Spain

Re: Limiting web navigation in a period of time

Postby escolar » 12 Jan 2017 06:23

The script I did is executed by cron every 5 minutes.

I think it's enough now. Maybe in the future we'll need other walls.


Return to “Software”

Who is online

Users browsing this forum: No registered users and 4 guests