Subversion restrict user access

寵の児 提交于 2019-12-11 17:53:11

问题


Can any one help me with this confusion… I have setup SVN server correctly with trunk, branch, tags and everything is working correctly. My problem is with authorization & access.

I have created SVN users, through command line, using the following command

htpasswd -cm /etc/svn-auth-users harry

and my subversion.conf file has the following -

<Location /svn>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion repositories"
AuthUserFile /etc/svn-auth-users
Require valid-user
</Location>

It is evident, that user and password (encrypted) stored in /etc/svn-auth-users

Question 1. Then what is the use of the files “authz” and “passwd” inside my repo/conf/ Question 2. In my situation, as stated above (i.e., using the file /etc/svn-auth-users), how do I restrict users to a particular branch.

Note: Everywhere, I see user access is restricted using the “authz” file.

.
.
.
[my_repo:/branches/calc]
harry = rw
bobby = r
.
.
.

I even tried that, but has no effect. Any user, created using the command line above, can access trunk. Any help is highly appreciated.


回答1:


The authz and passwd files in the repository directory are used if you access the repository via SVN's own protocol, e.g.: svn://server/repo

If you're using the apache module you'll access the repository via HTTP and apache will handle the authentication. You can also use the authz file (with identical syntax) for that, but you need to tell apache where it is in your configuration file:

<Location /svn>
    DAV svn
    SVNParentPath /var/www/svn
    AuthType Basic
    AuthName "Subversion repositories"
    AuthUserFile /etc/svn-auth-users

    AuthzSVNAccessFile /etc/svn-authz

    Require valid-user
</Location>


来源:https://stackoverflow.com/questions/20566589/subversion-restrict-user-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!