Nowadays the web is a loopy place, with plenty of gross and doubtlessly harmful content material out there. On account of how excessive the web can typically be, mother and father flip to parental controls and industrial filtering options. These work effectively however fail on the subject of organising a kid-friendly Linux PC.

Happily, there’s a fantastic open supply program for Linux customers that guarantees nice parental management options for the online. This system is DansGuardian, and it’s an open supply net filtering system that’s straightforward to arrange. Not like industrial filters, it doesn’t merely work primarily based on a listing of “banned sites”. As a substitute, customers can custom-tailor the filter to their wants, to guard their kids from inappropriate content material on-line.

The DansGuardian filtration software program works on all Linux distributions. That mentioned, Ubuntu is a good start line for many inexperienced persons. Consequently, we’ll primarily give attention to getting it working with Ubuntu Linux. Nevertheless, in the event you use one other working system of alternative, be happy to observe alongside and test the official web site for additional data.

Set up DansGuardian

Begin off by opening a terminal window and coming into the next command:

sudo apt set up iptables dansguardian squid

After putting in the software program, it’s additionally a good suggestion to replace Ubuntu. It will be certain that every part is operating absolutely the newest patches.

sudo apt replace

sudo apt improve -y

Ubuntu has all vital upgrades put in and the newest model of DansGuardian is on the system. The following step is to arrange a proxy system.

Set Up Squid Proxy

Squid is an internet caching proxy. It really works with DG to higher filter issues. It additionally quickens net site visitors too. There’s not a lot to do with Squid besides to switch some port settings. Utilizing the sed software, modify http_port.

sudo sed -i 's/http_port 3128/http_port 3128 clear/g' /and so forth/squid/squid.conf

After modifying the http_port, you’ll additionally want to vary the always_direct setting to “allow all”. Use the sed software to replace it.

sudo sed -i 's/# always_direct enable local-servers/always_direct enable all/g' /and so forth/squid/squid.conf

Squid is accurately configured. Flip it on with the begin command.

sudo squid begin

Configure DansGuardian

The Squid proxy is up and operating. Now it’s time to vary the “ban lists” within the filter software program. On this a part of the tutorial, we received’t be giving out a specified “ban list” for websites, URLs, and so forth., as a result of each father or mother’s wants are completely different. Utilizing the Nano modifying software, undergo and specify content material in these configuration information that you just’d like to dam.

Word: remember that youngsters are inventive and can discover methods to get round blocks, so that you’ll have to do a little analysis for the absolute best outcomes. Seek the advice of on parenting boards for finest outcomes.

FOPY8d9YftOkXhiZvkBiKgrWrvCZPMAAAAASUVORK5CYII=

To edit the listing of banned extensions for DG, do:

sudo nano /and so forth/dansguardian/lists/bannedextensionlist

Edit the listing of banned web sites in DG with:

sudo nano /and so forth/dansguardian/lists/bannedsitelist

Lastly, edit the listing of banned URLs in DG with:

sudo nano /and so forth/dansguardian/lists/bannedurllist

Save all edits with Ctrl + O. Exit Nano with Ctrl + X.

Do remember that DG might require IP addresses for URL’s and web sites, along with their area. Discover an IP deal with for a public web site with ping within the terminal. For instance:

ping fb.com -c1

The general public IP deal with for Fb is the quantity in parenthesis.

Squid Configuration

Squid is now working. All that’s left is to vary just a few extra choices. Begin off by eradicating “unconfigured” from the config file.

sudo sed -i 's/UNCONFIGURED - Please take away this line after configuration/#UNCONFIGURED - Please take away this line after configuration/g' /and so forth/dansguardian/dansguardian.conf

Subsequent, change the “filterip choice to equal the localhost IP (127.0.0.1).

sed -i 's/filterip =/filterip = 127.0.0.1/g' /and so forth/dansguardian/dansguardian.conf

Change the daemonuser entry within the configuration file for DG to proxy.

sed -i 's/#daemongroup = 'dansguardian'/daemongroup = 'proxy'/g' /and so forth/dansguardian/dansguardian.conf

Change accessdeniedaddress in the dansguardian.conf file to level to the right URL.

sed -i 's/accessdeniedaddress=" /and so forth/dansguardian/dansguardian.conf

Subsequent, block all connections on the PC, moreover ones going via the proxy.

sudo iptables -A OUTPUT -p tcp -m multiport --dports 80,443 -j DROP
sudo bash -c "iptables-save > /etc/dansguardian/iptables.save"
sudo sed -i "/exit 0/d" /and so forth/rc.native
sudo echo "iptables-restore /and so forth/dansguardian/iptables.save

exit 0
" >> /and so forth/rc.native

Alternatively, use this command to unblock a particular person, and block everybody else. Substitute “owner” together with your person.

sudo iptables -A OUTPUT -o lo -p tcp --dport 3128 -m proprietor --uid-owner USER -j ACCEPT
sudo bash -c "iptables-save > /etc/dansguardian/iptables.save"
sudo sed -i "/exit 0/d" /and so forth/rc.native
sudo echo "iptables-restore /and so forth/dansguardian/iptables.save

exit 0
" >> /and so forth/rc.native

Lastly, change the possession of the DG log information on Ubuntu in order that the proxy person can entry it, and begin DG.

sudo chown -R proxy:proxy /var/log/dansguardian

sudo systemctl allow dansguardian

sudo systemctl begin dansguardian

Proxy Settings

To begin utilizing DansGuardian, open up a terminal and enter the next proxy instructions:

gsettings set org.gnome.system.proxy mode 'guide' 

gsettings set org.gnome.system.proxy.http host 'localhost'

gsettings set org.gnome.system.proxy.http port 8080

Shut the terminal when carried out. Ubuntu ought to quickly be utilizing the DG proxy.



Source link

Share.
Leave A Reply

Exit mobile version