Execute os comandos:
cd /etc/squid
$ sudo mv squid.conf squid.conf.bk
$ sudo nano squid.conf
Colar dentro do squid.conf:
# [ Configuração de Portas e Nomes ]
http_port 3128
icp_port 3130
visible_hostname liesch-proxy
hierarchy_stoplist cgi-bin ?
acl QUERY urlpath_regex cgi-bin \?
cache_dir ufs /var/spool/squid 256 20 384
cache_mem 128 MB
# [ Melhoramento do Sistema e Cache ]
maximum_object_size 1024 MB
minimum_object_size 10 KB
cache_swap_low 50
cache_swap_high 90
cache_access_log /var/log/squid/access.log
error_directory /usr/share/squid/errors/Portuguese
refresh_pattern ^ftp: 1440 20% 10080
refresh_pattern ^gopher: 1440 0% 1440
refresh_pattern . 0 20% 4320
# [ Autenticação de Usuários ]
#colocar o --md5 para fazer a autenticação com criptografia md5
auth_param basic program /usr/lib/squid/basic_db_auth --md5
auth_param basic children 5
auth_param basic realm VOL Proxy - Digite o Usuário e a Senha:
auth_param basic credentialsttl 1 hours
auth_param basic casesensitive off
# [ Controle de Acessos ]
acl all src 0.0.0.0/0.0.0.0
delay_pools 1
delay_class 1 2
delay_parameters 1 194688/194688 39768/39768
delay_access 1 allow all
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl to_localhost dst 127.0.0.0/8
# [ Controle de Acessos - Safe Ports ]
acl Safe_ports port 21
acl Safe_ports port 70
acl Safe_ports port 80
acl Safe_ports port 210
acl Safe_ports port 280
acl Safe_ports port 443
acl Safe_ports port 488
acl Safe_ports port 591
acl Safe_ports port 631
acl Safe_ports port 873
acl Safe_ports port 1025
# [ Controle de Acessos - SSL Ports ]
acl SSL_ports port 443 563
acl SSL_ports port 873
acl purge method PURGE
acl CONNECT method CONNECT
no_cache deny QUERY
# [ Controle de Acessos - Http Access ]
http_access allow manager localhost
http_access deny manager
http_access allow purge localhost
http_access deny purge
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow localhost
http_access deny to_localhost
# [ ACLs Personalizadas ]
# mudar para a rede desejada
acl rede_interna src 193.189.0.0/24
acl usuarios proxy_auth /etc/squid/usuarios
# * Acessos Finais *
http_access allow usuarios
http_access deny all
http_access deny !rede_interna
http_access allow rede_interna
Salvar e criar um arquivo dentro da pasta do Squid chamado "usuarios":
sudo nano usuarios
Dentro do arquivo usuários colocar o nome dos usuários que estão inseridos no banco:
vol1
vol2
vol3
Salvar e pronto, já pode fazer a autenticação utilizando o banco.