1. Install Squid
apt install squid2. Install Apache util to activate authentication
apt install apache2-utils3. edit squid.conf using nano
nano /etc/squid/squid.conf4. paste the following config and save.
# port of proxy
http_port 5000
# hostname of proxy
visible_hostname debix
# IP header HTTP masking (X-Forwarded-For: unknown)
forwarded_for off
# logs
access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
# no cache
cache deny all
# DNS servers
dns_nameservers 80.67.169.12 80.67.169.40
# DNS cache
positive_dns_ttl 5 minutes #réponse positive
negative_ttl 5 minutes #réponse en erreur
# no wait before close Squid (30 seconds else, use of cache if enabled)
shutdown_lifetime 0 seconds
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid Basic Authentication
auth_param basic credentialsttl 5 hours
acl password proxy_auth REQUIRED
http_access allow password
4. make auth file
htpasswd -c /etc/squid/passwd <your custom username>5. restart the squid
systemctl restart squid
