Ubuntu install squid

Setting up undetectable proxy in a fresh new Ubuntu 18.04 in AWS EC2

sudo apt update
sudo apt upgrade
sudo apt install squid apache2-utils 

Create a credential file and add user.

sudo touch /etc/squid/passwd
sudo chown proxy: /etc/squid/passwd
sudo htpasswd /etc/squid/passwd oofnivek

Edit the configuration file at /etc/squid/squid.conf . Change the settings to the following below

forwarded_for delete
via off
request_header_access Cache-Control deny all 

Right below the acl ports. Add these.

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 2 hours
acl auth_users proxy_auth REQUIRED
http_access allow auth_users

Restart squid for changes to take effect.

sudo systemctl restart squid