I am testing both authentication with squid_passwd file and Mysql. This is my configuration
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/squid_passwd
# auth_param basic program /usr/lib/squid3/basic_db_auth --dsn "DBI:mysql:database=abc" --user "root" --password "aaa" --table "user" --usercol "User_Name" --passwdcol "Password" --cond "" --plaintext
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 1 minute
auth_param basic casesensitive off
# auth_param basic children 5
# auth_param basic realm Squid proxy-caching web server
# acl blocked dstdomain .google.com.vn .google.com.sg
acl db_auth proxy_auth REQUIRED
# acl restricted_users proxy_auth "/etc/squid3/restrictedusers"
# http_access deny restricted_users blocked
http_access allow db_auth
# And finally deny all other access to this proxy
http_access deny all
This is the content of squid_passwd
a2:$apr1$ovwnKYTS$hashedPassword
a1:$apr1$ovwnKYTS$hashedPassword
When I use squid_passwd
, it works fine (I set the proxy for firefox and then logged in successfully with the username/password
However, when I use the Mysql configuration (comment the line using squid_passwd
and un-comment the line using Mysql), I cannot logged in to proxy server, even the testing command works
/usr/lib/squid3/basic_db_auth --dsn "DBI:mysql:database=abc" --user "root" --password "aaa" --table "user" --usercol "User_Name" --passwdcol "Password" --cond "" --plaintext
a1 password
OK
(and cache.log
of squid also indicates that the authentication is successful)
Here is my User table
mysql> select User_Name, Password from user;
+-----------+----------+
| User_Name | Password |
+-----------+----------+
| a1 | password |
| a2 | password |
+-----------+----------+
What did I do wrong here ?
Try disabling SELinux in the system. This will fix the issue.