【发布时间】:2019-04-07 03:56:06
【问题描述】:
我正在尝试使用 squid 并将 2 个传出 ip 分别绑定到 2 个用户。
理想的结果是,我可以访问以下内容:
xxx.xxx.xxx.14:3128:user1:user1password
xxx.xxx.xxx.18:3128:user2:user2password
但不是:
xxx.xxx.xxx.14:3128:user2:user2password
xxx.xxx.xxx.18:3128:user1:user1password
我发现了一个类似的问题,并使用了类似的 squid.conf:
这是我的配置:
acl http proto http
acl port_80 port 80
acl port_443 port 443
acl CONNECT method CONNECT
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwords
acl ncsa_users proxy_auth REQUIRED
external_acl_type userIp %SRC %LOGIN /usr/lib64/squid/ext_file_userip_acl -f /etc/squid/userIp.conf
acl userIp external userIp
http_access deny !ncsa_users
http_access allow userIp
http_access deny all
http_port 3128
acl ip1 myip xxx.xxx.xxx.14
tcp_outgoing_address xxx.xxx.xxx.14 ip1
acl ip2 myip xxx.xxx.xxx.18
tcp_outgoing_address xxx.xxx.xxx.18 ip2
在我的 userIp.conf 中我有:
xxx.xxx.xxx.14 user1
xxx.xxx.xxx.18 user2
在我的 /etc/squid/passwords 我有以下由 htpasswd 创建的:
user1:encrypted password
user2:encrypted password
问题是: 如果我删除 'http_access deny !ncsa_users',那么 user1 可以同时访问 xxx.xxx.xxx.14 和 xxx.xxx.xxx.18。与 user2 相同。
但如果我保持 'http_access deny !ncsa_users' 不变,那么所有连接都会失败。
我觉得 'http_access allow userIp' 没有按预期工作。
我无法在网上搜索类似的问题...希望任何人都可以帮助我
【问题讨论】:
标签: authentication proxy acl squid