[SQUID] squid with auth - fourslickz/notes GitHub Wiki

apt update
apt install squid
install apache2-utils
htpasswd -c /etc/squid/passwords your_squid_username
nano /etc/squid/squid.conf
#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#
include /etc/squid/conf.d/*
auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid/passwords
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED

# Example rule allowing access from your local networks.
# acl localnet src your_ip_address
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
#http_access allow localnet
http_access allow localhost

# access authenticated user only
http_access allow authenticated

# And finally deny all other access to this proxy
http_access deny all
systemctl restart squid.service