I´m a newbie in linux, and I configured my subversion using a lot of tutorials on the internet.

My subversion uses webdav and I add my users using the command:

htpasswd /etc/apache2/dav_svn.passwd userb

My dav_svn.conf contains follow configuration:

<Location /svn>
    DAV svn
    SVNParentPath /svn
    AuthType Basic
    AuthName "Subversion Repository"
    AuthUserFile /etc/apache2/dav_svn.passwd
    Require valid-user

In the directory /svn I was created some repositories like /svn/test or /svn/chat.

My Question is: How can I restrict the respositories for specified users? Because all the users have permissions in all the repositories.


add the following line below AuthuserFile

AuthzSVNAccessFile /srv/svn/conf/authz

Of cource change the path to your svn root to point to the authz file.. Then it might look like

admin = user
devteam = user,user2,user3

@devteam = r
@admin = rw

@devteam = rw
@admin = rw

Adding onto Mike's answer from before, if you want the future capability to let users edit their own SVN access through a Trac plugin or similar, you could also give each SVN project its own Authz file. All my projects' SVN settings are held in separate files, one per project. Something like:

<Location /svn/projectname>
    DAV svn
    SVNPath /usr/local/svn/projectname
    AuthzSVNAccessFile /etc/apache2/authz/projectname

This would be a pain to manage manually, so you'd want some sort of configuration management software on the SVN server, or your own scripts to generate the separate Locations.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.