twitter
    Find out what I'm doing, Follow Me :)

Wednesday, December 5, 2012

Howto: Squid proxy authentication using ncsa_auth helper Centos 6.2


Configure an NCSA-style username and password authentication
1.htpasswd -c /etc/squid/passwd user1
2.chmod o+r /etc/squid/passwd

 Locate nsca_auth authentication helper
 If you are using RHEL/CentOS/Fedora Core or RPM based distro try:
3. rpm -ql squid | grep ncsa_auth

4.add below line in the TOP of squid.conf file. Remember on the TOP.

auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off

(Add this to the bottom of the ACL section of squid.conf)
acl ncsa_users proxy_auth REQUIRED 
(Add this at the top of the http_access section of squid.conf)
http_access allow ncsa_users 

e.g.
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl ncsa_users proxy_auth REQUIRED

# Only allow cachemgr access from localhost
http_access allow ncsa_users
http_access allow manager localhost
http_access allow our_networks
http_access deny manager

5. /etc/init.d/squid restart

No comments: