Заметки сисадмина о интересных вещах из мира IT, инструкции и рецензии. Alt26.Alt16. Настраиваем Компьютеры/Сервера/1С/SIP-телефонию в Москве

SQUID Proxy: Configuring for authentication, global access, and user-specific logging

2025-07-16 · Posted in Linux Debian / Ubuntu, Squid-cache

►1) Install Squid and htpasswd

First, update your package lists and install Squid and the apache2-utils package which provides htpasswd:

►2) Create a password file

Use htpasswd to create a file that will store your Squid user credentials. For example, to create a user named “testuser”:

You will be prompted to enter and confirm the password for this user. The -c flag is used only for the first user; omit it for subsequent users.

►3) Configure Squid

Edit the Squid configuration file,  Enable Basic Authentication. Add or modify the following lines to enable basic authentication:

Create Access Control Lists (ACLs) to control access based on authentication GLOBAL access:

Set the port Squid will listen on. Commonly 3128

If needed local without pass. This example allows authenticated users from the local network (replace 192.168.1.0/24 with your network) to access the proxy. It then denies access to all other requests:

►4) Restart Squid

After making these changes, restart the Squid service for them to take effect:

►5) Logs (%un is for an username from the /etc/squid/passwords)

Leave a Reply