To set up Squid proxy authentication on a Linux or Unix system, follow these steps:
apt
, yum
, or dnf
package manager to install Squid. For example:# apt-get install squid
/etc/squid/squid.conf
, to enable authentication. Add the following lines to the configuration file:auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hours acl authenticated proxy_auth REQUIRED http_access allow authenticated
This will enable basic authentication using the NCSA (Netware Common Server Agent) authentication module and the /etc/squid/passwd
password file. The acl
line defines an access control list (ACL) that allows access to authenticated users, and the http_access
line grants access to users that match the authenticated
ACL.
htpasswd
command. This will create a new password file or add a new user to an existing password file. For example:# htpasswd -c /etc/squid/passwd user1
This will create a new password file named /etc/squid/passwd
and add a user named user1
to the file.
systemctl
command to restart the Squid service. For example:# systemctl restart squid
This will restart the Squid service and apply the changes you made to the configuration file.
It's important to note that this is just one example of how to set up Squid proxy authentication on a Linux or Unix system. The specific steps may vary depending on your system and the version of Squid that you are using. Consult the Squid documentation and online resources for more information on how to set up and configure Squid proxy authentication.