Edit the Squid configuration file (/etc/squid/squid.conf). After the ports ACLs add the following lines:
Code:
auth_param basic program /usr/lib64/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
Save the file.
Create a file named passwd in the /etc/squid/ directory:
Code:
sudo touch /etc/squid/passwd
sudo chown proxy: /etc/squid/passwd
Run the following command to create a password (replace username with your actual username):
Code:
sudo htpasswd /etc/squid/passwd username
restart the Squid service for changes to take effect using:
Code:
sudo systemctl restart squid