论坛风格切换切换到宽版
  • 562阅读
  • 7回复

[问题求助][CentOS] 如何区别对待squid用户 [复制链接]

上一主题 下一主题
离线canko.
 
发帖
1960
C币
-199371
威望
333
贡献值
1
银元
-1
铜钱
4286
人人网人气币
0
只看楼主 倒序阅读 使用道具 楼主  发表于: 2009-05-01
请问,如何给不同的用户匹配不同的访问规则,比如允许A访问某个或某些站点但.是B不可以之类.的?服务器

评价一下你浏览此帖子的感受

精彩

感动

搞笑

开心

愤怒

无聊

灌水
离线zyjzhd.
发帖
2080
C币
-500792
威望
398
贡献值
4
银元
-1
铜钱
4717
人人网人气币
0
只看该作者 沙发  发表于: 2010-04-13
Re:[CentOS]
找到解决方法了.

离线dwbtongyi.
发帖
2171
C币
-60536
威望
368
贡献值
1
银元
0
铜钱
4781
人人网人气币
0
只看该作者 板凳  发表于: 2010-04-13
Re:[CentOS]
是啊,说说呗!

离线wshsky.
发帖
2033
C币
-263032
威望
340
贡献值
2
银元
-3
铜钱
4321
人人网人气币
0
只看该作者 地板  发表于: 2010-04-13
Re:[CentOS]
iptalbes 就可以识别用户的uid来做到

离线呼唤.
发帖
2030
C币
-60609
威望
360
贡献值
1
银元
-1
铜钱
4475
人人网人气币
0
只看该作者 4楼 发表于: 2010-04-13
Re:[CentOS]
这个uid必需是本机的吧?

发帖
2021
C币
-132535
威望
366
贡献值
1
银元
-3
铜钱
4503
人人网人气币
0
只看该作者 5楼 发表于: 2010-04-13
Re:[CentOS]
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.

离线tantan886.
发帖
2044
C币
-140694
威望
374
贡献值
1
银元
-1
铜钱
4597
人人网人气币
0
只看该作者 6楼 发表于: 2010-04-13
Re:[CentOS]
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不能

离线mirxx.
发帖
2121
C币
-152545
威望
392
贡献值
1
银元
-2
铜钱
4818
人人网人气币
0
只看该作者 7楼 发表于: 2010-04-13
Re:[CentOS]
lz说的是用户!
你说的大家都知道吧!
快速回复
限100 字节
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
上一个 下一个