authentication - 鱿鱼将每个传出IP绑定到用户?
问题描述
我正在尝试使用 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。与用户 2 相同。
但是,如果我保持'http_access deny !ncsa_users' 不变,那么所有连接都会失败。
我觉得“http_access allow userIp”没有按预期工作。
我无法在网上搜索类似的问题...希望有人可以帮助我
解决方案
好的,我现在想通了。
%SRC %LOGIN 对意味着指定用户自己的电脑地址的来源,这实际上不是我想要的。
我想要的实际上是 %MYADDR %LOGIN 对,它指定允许每个用户连接的 ips。
所以是的,这就是问题所在
推荐阅读
- xml - 需要创建空条目取决于列
- python - 在python中获取长时间运行脚本的windows shell输出
- r - R eurostat 特殊值“:”在数据库中
- websocket - 将数据推送到 Lua 中的 websocket 浏览器客户端
- selenium - 如何为 iframe 标签编写 xpath
- telerik - 如何在 Radgrid 中的 RadComboBox 的选定索引更改事件上动态设置 RadMaskedTextBox(在 EditItemTemplate 中)的 Mask 属性
- java - 如何在没有递归的情况下实现双向实体引用,示例如下
- java - 查询中的 SQL 变量导致意外的 SQL 语法错误
- python - 连续创建多个实例时使用正确的类实例
- javascript - 如何在 reactjs 中手动编辑表格行和表格标题