1. Edit squid.conf:
Code:
auth_param basic program /usr/local/libexec/squid/ncsa_auth /usr/local/etc/squid/users
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
2. Replace
Code:
http_access allow all
with:
Code:
acl users proxy_auth REQUIRED
http_access allow users
http_access deny all
3. Create
/usr/local/etc/squid/users file and add users there.
If you don't have the file yet, do this:
Code:
htpasswd -c /usr/local/etc/squid/users bob
New password: *****
Re-type new password: *****
Adding password for user bob
If you already have the file and want to add another user, do this:
Code:
htpasswd /usr/local/etc/squid/users mary
New password: *****
Re-type new password: *****
Adding password for user mary
You may look through the file:
Code:
cat /usr/local/etc/squid/users
bob:0Q2rNA.AEfZOk
4. Reconfigure SQUID.
Code:
squid -k reconfigure
If you need two groups of users - those who are to be authenticated and those who are not, you need to create 2 ACLs, and then use 2 http_access rules. Yo may need to play with the order of http_access rules to achieve the result.