November 25, 2024, 05:38:01 PM

News : LinuxSolved.com Linux Help Community Forum..


Author Topic: Block sites with mentioning it  (Read 8016 times)

Offline muthu

  • Linux Noob !
  • *
  • Posts: 17
Block sites with mentioning it
« on: April 18, 2005, 02:33:22 PM »
Dear Sir,


            I am using the Red Hat Linux 9v. I am using squid. In the Squid i am using NCSA (Authentication) for the users, in the users i resticting the sites for the particular users mentioned by me, For they can use the Internet in particular time for that particular users. But the squit it reponding to me that, it blocks all the sites, for that restricted particular users. So i am in need of to allow that users for the particular sites only at that particular time .. For the users, the remaining sites are to be allowed.

Thanks in advance,

S. Muthu

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Block sites with mentioning it
« Reply #1 on: April 19, 2005, 03:42:27 AM »
Do one  thing
go to this link:
http://www.siliconvalleyccie.com/linux-adv/squid.htm

Enjoy
Gaurav

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Block sites with mentioning it
« Reply #2 on: April 21, 2005, 03:46:48 AM »
Gaurav.. that link is not having solution for that ! anyways.

allowing certain websites for a particular user in particular time is rather a confusing acl. Lets try..

First of all we have to define user based on IP addres, secondly we have to define websites to allow, thirdly we have to define time acl and lastly make a rule to comply all !

for doing first option ie defining acl for particular user
Code: [Select]
acl user1 src 192.168.1.15
or for the group of users say 3
Code: [Select]
acl grp1 src 192.168.0.4 192.168.0.5 192.168.0.6

Now secondly we have to make a website list which we want to allow, we will put them in a text file. To do so create a file and put website which you want allow in that 1 url per line, say we create a file allowedsite.txt and want to allow only 5 websites.
The content of file allowedsite.txt :
Quote
yahoo.com
linuxsolved.com
google.com
tldp.org
linux.com

Now we have to create acl for this file
Code: [Select]
acl allowed_websites dstdomain  "/usr/local/squid/etc/allowedsite.txt"

Thirdly we have to create time acl when the user are allowed to do.. say they are allowed to do internet from 12:00 pm to 4:00 pm.
Code: [Select]
acl NOON time 12:00-16:00

Lastly we have to create acl when the particular user is accessing the internet at right time and only opening the allowed site.

Code: [Select]
http_access allow user1 allowed_websites NOON
http_access deny user1
http_access deny !allowed_websites


Well this code took me time to make but still you have to do testing and hope you got the idea how these stuff works. Still in confusion then please ask.

Offline gauravbajaj

  • LST CareTaker
  • Experienced
  • *****
  • Posts: 658
Block sites with mentioning it
« Reply #3 on: April 21, 2005, 04:00:52 AM »
RICKY I think u haven't studied  the link  carefully,First read it Care- fully then u will find the ans of ur question..
 I READ IT LOT OF TIMES THAT WHY I GAVE THE ANSWER....ITS NOT EXACTLY THE ANS OF HIS QUESTION BUT HE CAN GET IDEA HOW TO DO THIS...


& ALSO THE ANSWER U GAVE IS NOT FOR NCSA USERS.............,, iIT DOESN'T HOLD FOR NCSA USERS........, U GAVE ANSWER FOR IP_ADDRESSES NOT FOR NCSA USERS...................................
FIRST READ ABOUT NCSA AUTHENTICATION , THEN MAY BE U GET HIS QUESTION

AS I   ASKED THIS TYPE OF QUESTION( AUTHENTICATION OF USERS THROUGH SQUID  ) EARLIER ALSO BUT AT THAT TIME U DIDN"T KNOW ABOUT NCSA USERS ........, SO FIRST GIVE A LOOK AT NCSA USERS....



ENJOY
GAURAV

Offline Ricky

  • LST CareTaker
  • Specially Skilled
  • *****
  • Posts: 2381
Block sites with mentioning it
« Reply #4 on: April 21, 2005, 10:30:24 AM »
hmm..

I really ignored the NCSA authentication ... actually it took me time to make that answer and really forgot about NCSA thing. BTW.. in between I have set up authentication system on test to answer someone in this forum (but was long time ago) !

And about that link.. now I know it has time acls, ip base, etc.. I just thought it as simple squid configuration tutorial.. !

Anyways.. if this guy can post his squid.conf then I can suggest him further :)