Mic*_*ren 6 svn authentication ldap apache2 active-directory
我在Windows Server 2003上运行Apache/SVN,通过LDAP/Active Directory和平面文件进行身份验证.
除了任何 LDAP用户都可以访问所有内容之外,它工作得很好.我希望能够按用户或组限制SVN存储库.
理想情况下,我会得到这样的东西:
<Location /svn/repo1>
# Restricted to ldap-user1, file-user1, or members of ldap-group1,
# all others denied
</Location>
<Location /svn/repo2>
# Restricted to ldap-user2, file-user2, or members of ldap-group2,
# all others denied
</Location>
Run Code Online (Sandbox Code Playgroud)
真正的诀窍可能是我有混合身份验证:LDAP和文件:
<Location /svn>
DAV svn
SVNParentPath C:/svn_repository
AuthName "Subversion Repository"
AuthType Basic
AuthBasicProvider ldap file
AuthUserFile "svn-users.txt" #file-based, custom users
AuthzLDAPAuthoritative On
AuthLDAPBindDN ldapuseraccount@directory.com
AuthLDAPBindPassword ldappassword
AuthLDAPURL ldap://directory.com:389/cn=Users,dc=directory,dc=com?sAMAccountName?sub?(objectCategory=person)
Require valid-user
</Location>
Run Code Online (Sandbox Code Playgroud)
在我的谷歌搜索中,我看到有些人通过authz像这样拉入文件来实现这一点:
<Location /svn>
...
AuthzSVNAccessFile "conf/svn-authz.txt"
</Location
Run Code Online (Sandbox Code Playgroud)
然后,我需要映射AD用户.这种方法的任何例子?
这实际上比我想象的容易得多.我把它添加到我的位置:
<Location /svn>
...
AuthzSVNAccessFile "conf/svn-authz.txt"
</Location
Run Code Online (Sandbox Code Playgroud)
在该文件中,我只是指定了正常的SVN权限(此时系统似乎没有区分文件用户和LDAP用户):
[groups]
@admin = haren
###
### Deny all but administrators to the tree
###
[/]
* =
@admin = rw
###
### Allow more specific people on a per-repository basis below
###
[repo1:/]
ldap-user1 = rw
file-user1 = rw
[repo2:/]
ldap-user2 = rw
file-user2 = rw
Run Code Online (Sandbox Code Playgroud)
我仍在使用LDAP组语法来使该部分工作.任何建议都表示赞赏.
对于任何感兴趣的人,另一种替代方法:
Require ldap-group cn=SVN Users,cn=Users,dc=company,dc=com
Run Code Online (Sandbox Code Playgroud)
这假设您在Active Directory中创建了一个名为SVN Users的组.请注意,该组周围没有双引号.
使用它代替Require valid-user
然后,您可能无需在任何更改时重新启动Apache,只需将用户添加到AD中的组即可
| 归档时间: |
|
| 查看次数: |
24550 次 |
| 最近记录: |