免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1496 | 回复: 8
打印 上一主题 下一主题

如何区别对待squid用户 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-01-08 10:04 |只看该作者 |倒序浏览
请问,如何给不同的用户匹配不同的访问规则,比如允许A访问某个或某些站点但是B不可以之类的?

论坛徽章:
0
2 [报告]
发表于 2010-01-08 10:33 |只看该作者

回复 #1 pzjohn 的帖子

找到解决方法了.

论坛徽章:
5
寅虎
日期:2015-01-20 09:16:52亥猪
日期:2015-01-21 14:43:44IT运维版块每日发帖之星
日期:2015-12-17 06:20:00每日论坛发贴之星
日期:2015-12-17 06:20:00每周论坛发贴之星
日期:2015-12-20 22:22:00
3 [报告]
发表于 2010-01-08 10:35 |只看该作者

回复 #2 pzjohn 的帖子

什么问题,怎么解决的贴出来,方便后人查询阿

论坛徽章:
0
4 [报告]
发表于 2010-01-08 10:53 |只看该作者

回复 #3 gamester88 的帖子

是啊,说说呗!

论坛徽章:
0
5 [报告]
发表于 2010-01-08 10:55 |只看该作者
iptalbes 就可以识别用户的uid来做到

论坛徽章:
0
6 [报告]
发表于 2010-01-08 11:14 |只看该作者

回复 #5 7717060 的帖子

这个uid必需是本机的吧?

论坛徽章:
0
7 [报告]
发表于 2010-01-08 11:17 |只看该作者

回复 #6 wendaozhe 的帖子

man iptables:
  owner
       This  module  attempts to match various characteristics of the packet creator, for locally generated packets. This
       match is only valid in the OUTPUT and POSTROUTING chains. Forwarded packets do not have any socket associated with
       them. Packets from kernel threads do have a socket, but usually no owner.

       [!] --uid-owner username

       [!] --uid-owner userid[-userid]
              Matches  if  the  packet  socket's  file structure (if it has one) is owned by the given user. You may also
              specify a numerical UID, or an UID range.

       [!] --gid-owner groupname

       [!] --gid-owner groupid[-groupid]
              Matches if the packet socket's file structure is owned by the given group.  You may also specify a  numeri-
              cal GID, or a GID range.

       [!] --socket-exists
              Matches if the packet is associated with a socket.

论坛徽章:
0
8 [报告]
发表于 2010-01-08 11:37 |只看该作者
acl banned url_regex "/etc/squid/banned.list"
acl user1 src 192.168.2.2/32
acl user2 src 192.168.2.3/32
http_access allow user1 banned
http_access deny banned
http_access allow user1
http_access allow user2
http_access deny all

在banned.list里写上qq,则user1能访问www.qq.com而user2不能

论坛徽章:
0
9 [报告]
发表于 2010-01-08 11:39 |只看该作者

回复 #8 liucen 的帖子

lz说的是用户!
你说的大家都知道吧!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP