Ubuntu 16.04安装squid http代理,ldap认证配置
安装
- apt-get install squid
配置
- vi /etc/squid/squid.conf
类似如下
auth_param basic program /usr/lib/squid/basic_ldap_auth -v 3 -d -b "dc=nbhao,dc=org" -D cn=admin,dc=nbhao,dc=org -w password -f uid=%s ldap.nbhao.org
auth_param basic children 5
auth_param basic realm Web-Proxy
auth_param basic credentialsttl 1 minute
acl SSL_ports port 443
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 # https
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl CONNECT method CONNECT
acl localhost src 127.0.0.1/32 ::1
acl all src all
acl auth proxy_auth REQUIRED
http_access allow auth
http_access allow localhost
http_access deny all
http_port 3033
cache deny all
forwarded_for off
request_header_access X-Forwarded-For deny all
request_header_access From deny all
request_header_access Via deny all
参数:/usr/lib/squid/basic_ldap_auth -h
-v ldap版本
-d 开启debug
-b 基础的ldap dn搜索域
-D -w ldap登录的用户名密码
-f uid=%s 搜索过滤uid
ldap.nbhao.org ldap的地址
其他参考:
squid http代理nsca认证
https://wiki.squid-cache.org/ConfigExamples/Authenticate/Ldap