Skip to content

Instantly share code, notes, and snippets.

@Praseetha-KR
Last active October 23, 2023 20:37
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Praseetha-KR/3920ad51c75b8d8a5951122a2cb5e697 to your computer and use it in GitHub Desktop.
Save Praseetha-KR/3920ad51c75b8d8a5951122a2cb5e697 to your computer and use it in GitHub Desktop.
Squid proxy cloud-init config
#cloud-config
package_update: true
packages:
- squid
- apache2-utils
write_files:
- path: /etc/squid/squid.conf
content: |
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/htpasswd
auth_param basic realm proxy
acl authenticated proxy_auth REQUIRED
http_access allow authenticated
http_port 0.0.0.0:3128
runcmd:
- htpasswd -b -c /etc/squid/htpasswd USERNAME PASSWORD
- systemctl enable squid
- systemctl restart squid
- ufw enable
- ufw allow ssh
- ufw allow 'Squid'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment