LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-22-2010, 02:57 AM   #1
Cutty
LQ Newbie
 
Registered: Apr 2010
Posts: 3

Rep: Reputation: 0
Restricting users to access a certain website


Good Day,

I have an internet and mail server installed CentOS, and I want to restrict client machines to access a certain website, e.g. if i want restrict users from accessing the website: www.mydomain.com, How do I do it?

Regards,

Cutty

Last edited by Tinkster; 04-22-2010 at 05:45 PM. Reason: fix up URL
 
Old 04-22-2010, 03:05 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,629

Rep: Reputation: Disabled
Have you looked at squid. www.squid-cache.org/. Also look at Dansguardian
 
Old 04-22-2010, 03:05 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Hi, welcome to LQ!

You're not really saying much about your configuration - I'll
assume that you have a LAN in which a Linux machine is working
as a gateway ...

Have a look at using Squid and/or DansGuardian.



Cheers,
Tink
 
Old 04-22-2010, 03:06 AM   #4
Sayan Acharjee
Member
 
Registered: Feb 2010
Location: Chennai, India
Distribution: Manjaro
Posts: 616

Rep: Reputation: 64
Quote:
Originally Posted by Cutty View Post
Good Day,

I have an internet and mail server installed CentOS, and I want to restrict client machines to access a certain website, e.g. if i want restrict users from accessing the website: www.xxx.com, How do I do it?

Regards,

Cutty
Either setup squid and restrict the site or put the following line in client system's /etc/hosts file:
Quote:
127.0.0.1 www.mydomain.com
But remember if the client user have access to the file he can remove/edit the entry.

Last edited by Tinkster; 04-22-2010 at 05:45 PM.
 
Old 04-22-2010, 03:11 AM   #5
Lexus45
Member
 
Registered: Jan 2010
Location: Kurgan, Russia
Distribution: Slackware, Ubuntu
Posts: 352
Blog Entries: 3

Rep: Reputation: 47
Hi, Cutty.

You have several methods to achieve the effect.
The first one (and maybe less difficult) is to filter acces via iptables.
The second variant is to install and configure a proxy-server (say, Squid) and deny acces with the help of its ACLs (Access Control Lists).

For the first method you may try to use something like this on the machine which server as a gate for you LAN:
Code:
iptables -A FORWARD -p tcp -m string --string "mydomain.com" --algo kmp -j DROP

Last edited by Tinkster; 04-22-2010 at 05:44 PM.
 
Old 04-22-2010, 01:19 PM   #6
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Quote:
Originally Posted by sayan_acharjee View Post
Either setup squid and restrict the site or put the following line in client system's /etc/hosts file:
Code:
127.0.0.1 www.mydomain.com
But remember if the client user have access to the file he can remove/edit the entry.
He'd have to do that on every client, though. Not on
the Linux box.

Last edited by Tinkster; 04-22-2010 at 05:44 PM.
 
Old 04-22-2010, 05:22 PM   #7
Bratmon
Member
 
Registered: Jul 2009
Location: 75.126.162.205:80
Distribution: Arch / Mint 17
Posts: 297
Blog Entries: 3

Rep: Reputation: 50
Quote:
Originally Posted by Cutty View Post
Good Day,

I have an internet and mail server installed CentOS, and I want to restrict client machines to access a certain website, e.g. if i want restrict users from accessing the website: www.mydomain.com, How do I do it?

Regards,

Cutty
Notice: You used a terrible example website, specifically with the forum's automatic linking.

Last edited by Tinkster; 04-22-2010 at 05:44 PM. Reason: fix-up URL
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Restricting users? sdouble Linux - Newbie 5 07-05-2006 07:48 PM
restricting website access from local machine Stridier Linux - Networking 9 01-30-2006 05:26 AM
Restricting su to certain users roadin SUSE / openSUSE 4 03-15-2005 01:17 PM
Restricting internal LAN users access otisthegbs Linux - Security 15 05-17-2004 01:38 PM
How do I setup ProFTPD so users can access my website CPUguy387 Linux - Newbie 3 07-11-2003 12:07 AM


All times are GMT -5. The time now is 01:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration