问题
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