免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: seewo
打印 上一主题 下一主题

[proxy] Squid with AD authentication [复制链接]

论坛徽章:
0
11 [报告]
发表于 2006-08-24 12:29 |只看该作者
提供两点建议:
1: SAMBA 官方文档推荐:
If the requirement is for interoperation with MS Windows Server 2003, it will be necessary to ensure that you are using MIT Kerberos version 1.3.1 or later. Red Hat Linux 9 ships with MIT Kerberos 1.2.7 and thus requires updating.
先升级Krb5 试试。
2: 至于组认证通不过,可能先用命令行试试:
root# usr/local/squid/libexec/wbinfo_group.pl  回车
xh wt  手工输入用户名 及组的名字,看返回值是OK 还是 ERR.
OK       即可确认xh 是 wt 组的成员.

论坛徽章:
0
12 [报告]
发表于 2006-08-24 17:38 |只看该作者

回复 11楼 seewo 的帖子

谢谢楼主指点
但是实验多次,还是不成功
1、升级squid为2.6(其它不变),wbinfo -u和wbinfo -g显示正常,但是客户端访问时弹出要输入用户名和密码的对话框,验证不能通过,root# /usr/local/squid/libexec/wbinfo_group.pl。返回的是ERR  
2、krb5升级到1.4.4  代理升级到 squid2.6stable3,,还是和1一样
3、krb5升级到1.4.4  代理变回到 squid2.5stable2,客户端访问时不要输入用户名,而且注释外部ACL那几行可以访问网站。但是root# /usr/local/squid/libexec/wbinfo_group.pl   返回的仍是ERR
4、想升级SAMBA但包的依赖性不好处理,明天再原码安装SAMBA看看

[ 本帖最后由 xh0871 于 2006-8-24 18:13 编辑 ]

论坛徽章:
0
13 [报告]
发表于 2006-08-25 15:43 |只看该作者
Configuring Squid Proxy To Authenticate With Active Directory 不一定要加入AD的,其实我更愿意推荐另外一种认证机制:LDAP。

Microsoft AD 是一种LDAP v3 兼容的目录服务,Squid 也支持LDAP v3. 所有我们可以用LDAP得到与用Samba / Winbind同样的结果,而且不用象上面一样还要把机器加入AD。

这需要squid 2.5 或更高版本 (with Ldap helpers).
相关信息可以参考:
http://kb.papercutsoftware.com/Main/ConfiguringSquidProxyToAuthenticateWithActiveDirectory

Configuring Squid LDAP Authentication

The first step is to configure Squid to authenticate usernames/passwords with the Active Directory. You will need to open your Squid configuration file (squid.conf) and make the following changes:

Find the auth param section of the config file (TAG: auth_param), and change the auth param basic program line to look like this. (Indented text indicates one line)

    auth_param basic program /usr/lib/squid/ldap_auth -R
        -b "dc=vm-domain,dc=papercut,dc=biz"
        -D "cn=Administrator,cn=Users,dc=your,dc=domain,dc=com"
        -w "password" -f sAMAccountName=%s -h 192.168.1.75
    auth_param basic children 5
    auth_param basic realm Your Organisation Name
    auth_param basic credentialsttl 5 minutes

These settings tell Squid authenticate names/passwords in the Active Directory.

The -b option indicated the LDAP base distinguished name of your domain. E.g. your.domain.com would be dc=your,dc=domain,dc=com

The –D option indicates the user that is used to perform the LDAP query. (e.g an Administrator. This example uses the built-in Administrator user, however you can use another user of your choice.

The –w option is the password for the user specified in the –D option. For better security you can store the password in a file and use the –W /path/to/password_file syntax instead

-h is used to indicate the LDAP server to connect to. E.g. your domain controller.

-R is needed to make Squid authenticate against Windows AD

The –f option is the LDAP query used to lookup the user. In the above example, sAMAccountName=%s, will match if the user’s Windows logon name matches the username entered when prompted by Squid. You can search any value in the LDAP filter query. You may need to use an LDAP search query tool to help get the syntax correct for the –f search filter.

The %s is replaced with what the user enters as their username.

Remember to restart Squid to make these changes to come into effect.

Configuring Group Based Internet Access

Once the user has authenticated, you can define which users have access to network resources (i.e. the internet) using Squid access control lists (ACLs). Squid ACLs are a complex topic and allow very sophisticated control. This document only describes the basic configuration required to allow Active Directory / LDAP group checking - a requirement for PaperCut to deny/allow internet access. For further information on ACL syntax and configuration see the Squid documentation and FAQ.

In the Squid configuration file, find the external ACL section (TAG: external_acl_type) and specify the following external ACL (Inetgroup is arbitrary, make this anything appropriate). Note that this is all on one line.

    external_acl_type InetGroup %LOGIN /usr/lib/squid/squid_ldap_group -R
        -b "dc=vm-domain,dc=papercut,dc=biz"
        -D "cn=Administrator,cn=Users,dc=your,dc=domain,dc=com"
        -w "password"
        -f "(&(objectclass=person)(sAMAccountName=%v)(memberof=cn=%a,dc=your,dc=domain,dc=com))"
        -h 192.168.1.75

Most of this is similar to the LDAP authentication section above. The variable %v relates to the username and %a is the group given in the ACL (below). Ensure that the "memberof" filter is adjusted to where your LDAP internet group is defined. E.g. If you have an organizational unit call "you.domain.com/students", and this contains a group called "InternetAccessGroup", then the "memberof" part of the filter should be: memberof=cn=%a,ou=students,dc=your,dc=domain,dc=com

Then enter the values below in the ACL area (Tag: acl) of squid.conf, modifying your internal subnet as appropriate.

    acl localnet proxy_auth REQUIRED src 192.168.1.0/24

    acl InetAccess external InetGroup InternetAccessGroup

The ACL names are InetAccess, they are arbitrary and can be changed to suit your environment. InetGroup is the the External ACL name created above. The Active Directory groups that allow internet access is InternetAccessGroup. This is the name of the matching group in the Active Directory.

Now that you have completed the ACL you can reference them in the http_access area of Squid.conf:

    http_access allow InetAccess

You will need to restart Squid for these changes to come into effect.

You should then be able to try to access the Internet using Squid, and should be prompted for your Windows username and password. Only authenticated users AND users belonging to the "InternetAccessGroup" will be allowed access to the internet. This test by manually adding and removing users from the group using the Active Directory user management tools. The users should be granted/denied access depending on their AD group membership.

NOTE: If you have the need to deny Internet access for members of another Windows security group, you can set up a "InternetDenyGroup" the same way as above and then define an InetDeny ACL. You can then specify a http_access deny rule as follows:

    http_access deny InetDeny

Acknowledgements

Thanks to Ryan Brinch (Network Administrator, Linwood College, New Zealand) for his assistance helping PaperCut Software write this guide. Ryan would also like to thank Stephen Fergusson, for helping in the reviewing and checking this document.

试试再告诉大家结果。
上面所写的方法没有弹出对话框要你输入用户名及密码,LDAP 可能要,试试才知.

[ 本帖最后由 seewo 于 2006-8-25 17:42 编辑 ]

论坛徽章:
0
14 [报告]
发表于 2006-08-25 17:17 |只看该作者

回复 13楼 seewo 的帖子

我想先用AD把功能实现,可能是因为做了一大半了,不想放弃吧。
想换个LINUX来试一下
功能实现后再把其它认证做一下

我在这方面的知识太少,不够用,所以应该多找点相关资料才行
可是中文资料不多,而英文看着有点头晕

只能不断的学习

论坛徽章:
0
15 [报告]
发表于 2006-08-25 18:38 |只看该作者

回复 13楼 seewo 的帖子

用FC5来做出现新问题
service winbind stop 失败
service winbind restart 时就出现下面问题
WINBIND已死 但 PID文件仍在
WINBIND已死但SUBSYS被锁
删除.pid 和subsys还是启动不了winbind

论坛徽章:
0
16 [报告]
发表于 2008-10-16 16:39 |只看该作者
参考lz 好文,完成了这个实验,准备实施。赞lz 一个.

论坛徽章:
0
17 [报告]
发表于 2009-12-24 23:04 |只看该作者
我用的是squid 2.6 + windows 2003实现加入域的计算机无需输入用户名和密码即可上网,非域中的计算机需要输入用户名密码来来通过验证上网,同时也实现了组验证,但是现在有部分用户的操作系统升级到windows 7了,但windows 7无法通过squid的验证  samba也无法通过验证,不知道和位有没有好的解决办法…………
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP