[squid-users] Squid-cache authentication is not working

Alex Rousskov rousskov at measurement-factory.com
Sat Sep 9 22:31:32 UTC 2023


On 2023-09-09 18:27, Alex Rousskov wrote:
> On 2023-09-09 15:09, Jason Long wrote:
> 
>> My Squid-cache server IP is "192.168.1.2".
>> I use Mozilla Firefox and set the proxy to "192.168.1.2:3128".
>> What information do you need to tell you?
> 
> Do you see Firefox requests/transactions reflected in Squid access.log?
> 
> Anything in Squid cache.log?
> 
> Sorry, I do not know where those logs are on your machine. Typical 
> locations include /var/log/ and /usr/local/squid/var/logs
> 
> Another thing to check is whether the http_access rules you have added 
> are in the right place. If you simply appended those rules to the 
> default Squid configuration file, then they will not work (because 
> http_access rules above them will be used instead). Default squid.conf 
> marks the place where you should insert custom http_access rules: Look 
> for an "INSERT YOUR OWN RULE(S) HERE" comment.
> 
> You can check this second theory by removing "http_access allow 
> auth_users" and leaving just the "http_access deny all" rule that you 
> have added earlier. If everything still works, then either Squid does 
> not receive these requests at all (i.e. the first theory) or your access 
> rules are too low (i.e. this second theory).

... or the attempt to reconfigure Squid did not have an effect (e.g., 
your Squid is not using the configuration file you are editing). There 
are other possible problems/explanations as well. I did not mean to 
imply that these theories are the only possible ones.

Alex.


>>     On Sat, Sep 9, 2023 at 5:56 PM, Alex Rousskov
>>     <rousskov at measurement-factory.com> wrote:
>>     On 2023-09-09 09:09, Jason Long wrote:
>>
>>      > Hello,
>>      > I installed the Squid-cache on Debian 12, then I installed the
>>     Apache utils:
>>      >
>>      > $ sudo apt install apache2-utils
>>      >
>>      > After it, I did the following steps:
>>      >
>>      > $ sudo touch /etc/squid/passwd
>>      > $ sudo chown proxy /etc/squid/passwd
>>      >
>>      > Then:
>>      >
>>      > $ sudo htpasswd /etc/squid/passwd jason
>>      >
>>      > After it, I opened the "/etc/squid/squid.conf" file and add the
>>     following lines to it:
>>      >
>>      > auth_param basic program /usr/lib/squid/basic_ncsa_auth
>>     /etc/squid/passwd
>>      > auth_param basic children 5
>>      > auth_param basic realm Squid Basic Authentication
>>      > auth_param basic credentialsttl 2 hours
>>      > acl auth_users proxy_auth REQUIRED
>>      > http_access allow auth_users
>>      > http_access deny all
>>      >
>>      >
>>      > Finally:
>>      > $ sudo systemctl restart squid
>>      >
>>      > But, on the client machine, I can visit any website without the
>>     username and password.
>>      > Which part of the configuration is wrong?
>>
>>
>>
>>     Many things could go wrong, but I would start from the beginning:
>>     Perhaps the client (browser) is not configured to use the proxy? 
>> Do you
>>     see client transactions reflected in Squid access.log? Anything in
>>     Squid
>>     cache.log?
>>
>>     HTH,
>>
>>     Alex.
>>
>>
>>     _______________________________________________
>>     squid-users mailing list
>>     squid-users at lists.squid-cache.org
>>     <mailto:squid-users at lists.squid-cache.org>
>>     https://lists.squid-cache.org/listinfo/squid-users
>>     <https://lists.squid-cache.org/listinfo/squid-users>
>>
> 
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> https://lists.squid-cache.org/listinfo/squid-users



More information about the squid-users mailing list