Use Basic Authentication Squid

Use Basic Authentication Squid

Use Basic Authentication Squid

In this scenario we are configuring a HTTP proxy to require basic authentication, such as a username/password combo. We are assuming that you have already configured your proxy for HTTP, and you want to add this functionality.

If not, check here

blog.zwiegnet.com/linux-server/configure-squid-http-proxy-centos-6/

Login and su to root

Root shell prompt on the squid proxy server

as always, make a backup of the squid config

Root prompt on the squid server before backing up squid.conf

from here we need to install the htpasswd package

yum -y install httpd-tools to get the htpasswd command

back in the squid.conf file the acl CONNECT method CONNECT, and modify as follows:

squid.conf auth_param basic ncsa_auth lines with acl password proxy_auth REQUIRED

from here create a username/password, for this example we used the username “squid”

htpasswd -c /etc/squid/.htpasswd squid adding password for user squid

now we can’t forget to restart the squid service…

service squid restart, Stopping and Starting squid OK

now go to the web browser of the squid client you already have setup, as you can see, it wants a username/password

Browser on the proxy client prompting for user name and password

go ahead and enter squid

That’s it!

Hosted Linux Servers at www.zwiegnet.com/go

Related guides: Configure Squid LDAP Authentication | Load Balance Squid Reverse Proxy

Leave a Reply

Your email address will not be published. Required fields are marked *