sudo apt update
sudo apt upgrade -ysudo apt install squid apache2-utils -yAfter installation Squid proxy is already running, but will deny all outbound connections by default.
Create a password file
sudo touch /etc/squid/passwdCreate a user named gerbill (you can name this user whatever you want)
sudo htpasswd /etc/squid/passwd gerbillThis command will prompt you to enter a password for this user twice. Any password will do, but be aware - bots are constantly scanning for missconfigured or weakly protected proxy servers to use them for shady things later. Make sure to use a strong password!
Open squid.conf in your editor of choice. I'm using nano
sudo nano /etc/squid/squid.confRight at the top of squid.conf above the # WELCOME TO SQUID .... line paste in the following 3 lines
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
acl squid_users proxy_auth REQUIRED
http_access allow squid_users
Save changes to squid.conf and restart Squid server for the changes to take effect
service squid restartSearch for http_access deny all inside squid.conf and change this line to http_access allow all.
Save changes to squid.conf and restart Squid server for the changes to take effect
service squid restartSquid server listens to 3128 port by default. You may change this port in order to further enhance your proxy server's security.
Once again open up squid.conf in an editor and find a line that contains http_port 3128. Edit the default port number 3128 to, for example 8765 or whichever port number you like.
Save changes to squid.conf and restart Squid server for the changes to take effect
service squid restart