Setting up Squid Proxy on Debian
Today we’ll quickly set up a squid proxy on Debian to route our traffic via the proxy. We only allow the connection with username and password. In addition, we only allow IPv4 and disable the cache and logs completely.
sudo apt update
sudo apt upgrade -y
sudo apt install squid apache2-utils -y
sudo htpasswd -c /etc/squid/passwords username
#enter password
sudo chown proxy: /etc/squid/passwords
sudo chmod 640 /etc/squid/passwords
sudo rm /etc/squid/squid.conf
sudo nano /etc/squid/squid.conf
Insert configuration (in this example without cache and logs):
http_port 442
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwords
auth_param basic realm Squid Proxy
auth_param basic credentialsttl 24 hours
auth_param basic casesensitive off
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
http_access deny all
dns_v4_first on
forwarded_for delete
via off
cache deny all
access_log none
Restart Squid:
sudo systemctl restart squidSet settings in the browser

Authenticate with user/password combination and enable ports if necessary.