LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 04-10-2005, 10:27 AM   #1
Stridier
LQ Newbie
 
Registered: Apr 2005
Location: Singapore
Distribution: SuSE
Posts: 9

Rep: Reputation: 0
restricting website access from local machine


Hi there,

I have set up my SuSE linux box, and now I want to restrict the machine from accessing particular websites. Is there any way i can do that? is there any extensions for the firefox browser?

Thanks,
 
Old 04-10-2005, 10:42 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
I can't think of any extensions but since you could easily use another browser I'm not sure that is the best way to do it. A transparent proxy with squid and a blacklist would probably work better.
 
Old 04-10-2005, 10:57 AM   #3
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
depending on who you're trying to keep the sites from, you could add them to your /etc/hosts file with the loopbackaddress.
127.0.0.1 www.msn.com
 
Old 04-11-2005, 07:19 AM   #4
linuxxed
Member
 
Registered: Feb 2004
Posts: 273

Rep: Reputation: 30
Re: restricting website access from local machine

Quote:
Originally posted by Stridier
Hi there,

I have set up my SuSE linux box, and now I want to restrict the machine from accessing particular websites. Is there any way i can do that? is there any extensions for the firefox browser?

Thanks,
Squid is ideal for this kind of stuff but you can also use IPTables to restrict the OUTPUT chain and deny packets to particular websites.
 
Old 04-11-2005, 12:19 PM   #5
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
You'll also need to take into account the fact that external proxies could be used.

Another advantage of squid is that you can block by hostname and even regular expressions these are not available with iptables.
 
Old 04-12-2005, 08:17 PM   #6
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora
Posts: 161

Rep: Reputation: 43
Try privoxy (http://www.privoxy.org/).

Supports site blocking, image file handling, cookie blocking, header filtering, HTML and Java abuse etc.

Once set up you just need to configure the client browsers to use your privoxy server as a web proxy. Simple to do manually but complicated to automate. Once it's working you can block browsers from bypassing the proxy at the Internet gateway - either your Suse box or your router.

P.S. Tell your users what's happening BEFORE you cut off their unrestricted access - they tend to get rather upset!
 
Old 04-17-2005, 02:55 AM   #7
Stridier
LQ Newbie
 
Registered: Apr 2005
Location: Singapore
Distribution: SuSE
Posts: 9

Original Poster
Rep: Reputation: 0
Thanks for all your information, I am trying to install squid and dan's guardian.
 
Old 04-17-2005, 09:35 AM   #8
Stridier
LQ Newbie
 
Registered: Apr 2005
Location: Singapore
Distribution: SuSE
Posts: 9

Original Poster
Rep: Reputation: 0
Quote:
Originally posted by DaveG
Try privoxy (http://www.privoxy.org/).

Supports site blocking, image file handling, cookie blocking, header filtering, HTML and Java abuse etc.

Once set up you just need to configure the client browsers to use your privoxy server as a web proxy. Simple to do manually but complicated to automate. Once it's working you can block browsers from bypassing the proxy at the Internet gateway - either your Suse box or your router.

P.S. Tell your users what's happening BEFORE you cut off their unrestricted access - they tend to get rather upset!
I tried to install both from suse rpm and source, neither is successful.

below is an error message with source install:

linux:/local/download/privoxy-3.0.3-stable # make install
Creating directories, and preparing Privoxy 3.0.3 installation
chmod 0755 ./mkinstalldirs
mkdir /usr/local/etc
mkdir /usr/local/etc/privoxy
mkdir /usr/local/etc/privoxy/templates
mkdir /var/log/privoxy
Installing privoxy executable to /usr/local/sbin
/usr/bin/install -c -m 0755 privoxy /usr/local/sbin
mkdir /usr/local/share/doc
mkdir /usr/local/share/doc/privoxy
mkdir /usr/local/share/doc/privoxy/user-manual
mkdir /usr/local/share/doc/privoxy/faq
mkdir /usr/local/share/doc/privoxy/developer-manual
mkdir /usr/local/share/doc/privoxy/man-page
mkdir /usr/local/share/doc/privoxy/images
Installing FAQ, Manual, and other docs to /usr/local/share/doc/privoxy
Installing man page to /usr/local/man/man1/privoxy.1
/usr/bin/install -c -m 0664 privoxy.1 /usr/local/man/man1/privoxy.1
Rewriting config for this installation
sed 's+confdir .+confdir /usr/local/etc/privoxy+' config | \
sed 's+logdir .+logdir /var/log/privoxy+' >config.updated
mv config config.base
mv config.updated config
Installing templates to /usr/local/etc/privoxy/templates
id: privoxy: No such user
******************************************************************
WARNING! WARNING! installing config files as root!
It is strongly recommended to run privoxy as a non-root user,
and to install the config files as that user and/or group!
Please read INSTALL, and create a privoxy user and group!
*******************************************************************
make: *** [install] Error 1
linux:/local/download/privoxy-3.0.3-stable # ls /usr/local/etc/privoxy/
. .. templates
linux:/local/download/privoxy-3.0.3-stable #
 
Old 04-17-2005, 04:55 PM   #9
DaveG
Member
 
Registered: Nov 2001
Location: London, UK
Distribution: Fedora
Posts: 161

Rep: Reputation: 43
Looks like the installation is expecting a separate account to own the configuration files and run the service. The binary RPM should take care of that during installation but you can do it manually, as root:
# groupadd -g 73 privoxy
# useradd -u 73 -g 73 -d /usr/local/etc/privoxy -r -s "/sbin/nologin" privoxy
and run make install again.
Another option would be to rebuild from the source RPM - download the latest privoxy/SuSE source package and run:
# rpm --rebuild privoxy-*.src.rpm
That should build a new binary RPM for you using the libraries installed on your machine. That binary should install OK.

I'm not sure how SuSE controls services (FC3 uses chkconfig and /sbin/service) but you will need to check how to start and stop privoxy and set up firewall access.
The privoxy configuration files have LOTS of comments and advice on how to customise the blocking and privacy options plus a pretty good on-line manual.

Have fun,

-- DaveG
 
Old 01-30-2006, 04:26 AM   #10
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Here is a link on controlling internet access. The controlled host has to go through a squid proxy server. The content is controlled by the DansGuardian program.

http://www.cecea.org/jojo/cleanweb/
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
scp: copy a file from local machine to remote machine seran Linux - Newbie 8 10-30-2007 12:23 PM
Setup local machine to allow lan machines to retrieve its local user mail. Brian1 Linux - Networking 3 03-30-2006 05:04 AM
how to open a dilog on local machine when i do ssh to remote machine fahad26 Programming 3 05-03-2005 07:39 PM
restricting an email account to receive mails from local users only dm0nkz Linux - Security 2 09-03-2004 02:08 AM
Can not access localhost from local machine - RedHat 9 acepukas Linux - Networking 3 12-09-2003 01:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:31 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration