Sunday, March 14, 2010

Howto: Use NCSA authentication with Squid

A very simple way to control access to squid is to use the NCSA authentication module.

First ensure Squid is configured to use the NCSA module, for example put the following line in squid.conf

auth_param basic program /opt/squid/libexec/ncsa_auth /opt/squid/etc/squid_pwd

Then from the command prompt call htpasswd, to the password file, for the user

htpasswd /opt/squid/etc/squid_pwd user1

New password:
Re-type new password: Adding password for user user1
Then, you need to make sure that the password file is readable

# chmod o+r /etc/squid/passwd

No comments: