首页 > 其他 > 详细

squid代理加用户认证

时间:2018-08-27 23:43:10      阅读:194      评论:0      收藏:0      [点我收藏+]

squid代理加用户认证

 

用authentication helpers添加身份验证

有如下几种认证方式 :
=> NCSA: Uses an NCSA-style username and password file.
=> LDAP: Uses the Lightweight Directory Access Protocol
=> MSNT: Uses a Windows NT authentication domain.
=> PAM: Uses the Linux Pluggable Authentication Modules scheme.
=> SMB: Uses a SMB server like Windows NT or Samba.
=> getpwam: Uses the old-fashioned Unix password file.
=> SASL: Uses SALS libraries.
=> NTLM, Negotiate and Digest authentication

配置NCSA 认证


一、创建认证用户名/密码,用htpasswd

  1. #htpasswd  /etc/squid/passwd user1

输入密码
New password:
Re-type new password:

二、确定squid是否支持authentication helper

yum 安装的

  1. #rpm -ql squid | grep ncsa_auth

输出:
/usr/lib64/squid/ncsa_auth


三、配置SQUID认证
# vi /etc/squid/squid.conf

加入验证部分内容:

  1. auth_param basic program /usr/lib64/squid/ncsa_auth /etc/squid/passwd     //定义squid密码文件与ncsa_auth文件位置
  2. auth_param basic children 15          //认证进程的数量
  3. auth_param basic realm Squid proxy-caching web server
  4. auth_param basic credentialsttl 2 hours        //认证有效期
  5. auth_param basic casesensitive off             //用户名不区分大小写,可改为ON区分大小写

添加 acl 验证用户:

  1. acl ncsa_users proxy_auth REQUIRED
  2. http_access allow ncsa_users

四、重启squid生效
# /etc/init.d/squid restart

squid代理加用户认证

原文:https://www.cnblogs.com/smilezgy/p/9545513.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!