概述

为了更好的管理squid服务器并防止其他用户非法访问需要进行用户认证来规范使用。

修改配置

生成密码文件
[root@localhost squid]# htpasswd  -c /usr/local/squid/passwd ymcc
New password: 
Re-type new password: 
Adding password for user ymcc
添加配置文件内容

认证程序地址

  • 默认安装目录:/usr/lib64/squid/basic_ncsa_auth
  • 指定安装目录:/usr/local/squid/libexec/basic_ncsa_auth
#配置密钥验证
auth_param basic program /usr/local/squid/libexec/basic_ncsa_auth /usr/local/squid/passwd
#普通用户需要通过认证才能访问Internet
acl auth_user proxy_auth REQUIRED
http_access allow auth_user
#有效时间2小时
auth_param basic credentialsttl 2 hours
#指定认证程序的进程数
auth_param basic children 5
http_access deny all
END

本文标题:Squid配置用户认证登录

本文作者:宇宙最帅的男人

本文链接:https://lolicp.com/linux/20211591.html

版权声明:转载或者引用本文内容请注明来源及原作者,本文著作权归作者 (宇宙最帅的男人) 所有。

除非另有说明,本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

最后修改:2021 年 06 月 15 日
如果觉得我的文章对你有用,请随意赞赏