EnServe Guides
contents
How To...

Set up User Authentication for Squid

You can restrict access to the web based by user name. This is NOT enabled by default and you do have a couple of steps to carry out before it can be used.

This is NOT on the menu system as we are not sure of the number of practices that will be wanting to use it.

The first step is done via the Admin Menu as per the other guide, you need to look for the line in the Squid Config file:

#  TAG: authenticate_program
#	Specify the command for the external authenticator.  Such a
#	program reads a line containing "username password" and replies
#	"OK" or "ERR" in an endless loop.  If you use an authenticator,
#	make sure you have 1 acl of type proxy_auth.  By default, the
#	authenticator_program is not used.
#
#
# authenticate_program /usr/local/squid/bin/ncsa_auth /usr/local/squid/etc/passwd

Remove the # from the start of the line so you have:

authenticate_program /usr/local/squid/bin/ncsa_auth /usr/local/squid/etc/passwd

(Don't worry if the actual paths to squid are not the same on your version.)

Make a note of the 3rd field, in my case /usr/local/squid/etc/passwd, quit out of the Admin menu and login as root.

At the # prompt type:

/usr/lib/apache/bin/htpasswd -c `3rd field` username

So to add the user 'tom' using the details here I would enter:

/usr/lib/apache/bin/htpasswd -c /usr/local/squid/etc/passwd tom

You will be prompted for the password (twice), once you are back to the # prompt you can log out/in and carry on as normal.


FAQ's