打开这个在线htpasswd生成器工具,设置一个用户名密码(随便设置),选择md5方式,点击生成:
工具地址:https://tool.bfw.wiki/tool/1634458441162886.html
将生成结果复制,然后在新建一个/etc/squid/passwdfile文件,文件内容为上面的生成结果
设置一下权限
chown squid /etc/squid/passwdfile
编辑squid配置文件
换成下面
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwdfile auth_param basic children 5 auth_param basic realm Squid proxy-caching web server auth_param basic credentialsttl 2 hours acl authenticated_users proxy_auth REQUIRED http_access allow authenticated_users重启squid即可
systemctl restart squid
客户端访问就会弹出输入用户名和密码的窗口,输入真确后就能正常使用代理服务了。
网友回复