Linux Forums - Linux Help,Advice & support community:LinuxSolved.com
Network Troublshooting => Linux Servers Support => Topic started by: lovelysandu on July 23, 2004, 11:50:53 AM
-
hello,
I want to use authotication for squid,
can anyone tell me how to do that.
sandesh
-
Well.. there are lots of method to do this..
I am giving you all available.. What you do .. search for all in google.com/linux you will then find good tutorials
1. Ldap
2. NCSA
3. MSNT
4. PAM
5. SMB
So you go and read little abt each and decide which one to use.. then configure that.
-
Thanks,
I want to use NCSA or PAM authentication
can u tell me step by step configuration for that
Thanks and Regards
Sandesh
-
Ok . I am giving a brief about NCSA
First you have to compile NCSA modules. You can find that in squid package under the directory auth_modules (usually)
first do make then make install
first go to that directory then to NCSA source and do
make
make install
It will creat ncsa_auth usually in /usr/local/squid/sbin .
Now modify your squid.conf to use ncsa_auth
#This part is to be added in squi.conf
#below we are telling which authentication module to use and which password file to use.
authenticate_program /usr/local/squid/sbin/ncsa_auth /usr/local/squid/etc/passwd
#here we will describe how long authentication is valid etc.
authenticate_ttl 900
authenticate_ip_ttl 60
acl name proxy_auth REQUIRED
http_access allow lan name
http_access deny all
Here lan is predefined acl we use for our local network so it means allow authentication over Lan.
NOw we have to make file /usr/local/squid/etc/passwd .
we will store username and encrypted password in that using htpasswd utility came with Apache.
so to make file and also user for first time do following
htpasswd -c /usr/local/squid/etc/passwd
lovelysandu
# then will ask for password :: so give password.
to add next user simply remove -c
htpasswd /usr/local/squid/etc/passwd
newusername and then password
Also change permission for /usr/local/squid/etc/passwd to 755 by
chmod 755 /usr/local/squid/etc/passwd
So your basic authentication using NCSA is done.. restart squid and then open some site. it will first ask for authentication..
Ok.. done...