Squid Proxy Authentication

I run a squid proxy on one of my Linode vps. Configuration for username and password authentication was done as follows while logged in as root:

1. Install script via:

yum install squid

on CentOS or Red Hat based Linux flavors, or

apt-get update
apt-get install squid

on Debian Linux flavors.

2. Create a password file and chmod for file permission

touch /etc/squid/squid_passwd

chmod o+r /etc/squid/squid_passwd

3. Add a user for the proxy server

htpasswd /etc/squid/squid_passwd test

4. Find the ncsa_auth file

find / -name ncsa_auth

5. Edit the squid.conf file

vi /etc/squid/squid.conf

6. Add the following lines to the squid.conf file

auth_param basic program <location-of-ncsa_auth-file> /etc/squid/squid_passwd

acl ncsa_users proxy_auth REQUIRED

http_access allow ncsa_users

7. Reload squid

service squid restart (in RH based)

/etc/init.d/squid restart (in Debian Based)

Gulshan Yashveer Beejan

Gulshan holds a BSc(Hons) Computer Science with Distributed systems from the City University of London. He is currently working at DSOGroup(Mauritius) as a Linux Administrator on SaaS Solutions. More about Gulshan

Leave a Reply

Your email address will not be published. Required fields are marked *