user1592380
user1592380

Reputation: 36317

Basic auth using squid proxy

I'm trying to make Squid3 to use basic authentication. I'm setting this up on ubuntu14.04 on EC2

I started by following http://hackingonstuff.net/post/23929749838/setting-up-a-squid-proxy-on-aws and have manged to get it working without auth.

Now I'm trying to follow http://soad1982.blogspot.com/2013/05/squid-proxy-on-aws.html to set up the basic auth

my squid.conf CONTAINS:

acl all src all
acl SSL_ports port 443
acl CONNECT method CONNECT
http_access allow all
http_port 3128
hierarchy_stoplist cgi-bin ?
coredump_dir /var/spool/squid3    


auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl foo proxy_auth REQUIRED
http_access deny !foo
http_access allow foo
http_access deny all

I'm trying to create /etc/squid3/passwd with:

sudo htpasswd -c /etc/squid3/passwd myusername

This seems to work ok. I restarted using:

sudo restart squid3

When I set my browser to surf through the proxy, I get the right ip address according to http://www.whatsmyip.org/ but I'm not prompted for the password or username.

What am I doing wrong?

Upvotes: 2

Views: 6126

Answers (1)

Knut
Knut

Reputation: 1790

It's a long time since I configured a squid but as far as I remember the directive http_access allow all in line 4 of your configuration makes the 3 lines at the very bottom obsolete… You might try to remove that one.

Upvotes: 3

Related Questions