Access Control in SVN with authz_svn

In this post I will show you, how to control access in SVN using builtin moudle called authz_svn.It allows you to control the access in such a way that who can access the repository and what they can do on the repository (read or read-write), it even allows you to make groups and define access permission for groups. Above than that, you don’t need to change the underlay structure of your svn server.

Note: If you want to install the SVN Server then, please refer this post:

These are the same usernames that we created in previous tutorial, using this command:

sudo htpasswd -m /etc/apache2/dav_svn.passwd arbab

For this post, we will use these repositories :

cd /svn
ls -l

For this post, we will use these users:

cat /etc/apache2/dav_svn.passwd

We need to create an Access Control file, where we define the permission on the repositories:

sudo nano /etc/apache2/svn_access_control

These are the permissions that we configured on the repositories:

fighter = tom, jerry
team = nobita, bheem
arbab = rw
@team = r
@fighter = rw
nobita = rw
tom = r
jerry = rw
bheem = r

In the above example:

Created a group fighter with two members; tom and jerry.
Created another group, called team with two members; novita and bheem.
arbab has given the read and write permissions on all the repositories.
On test repository, team group has read while fighter group has read and write permission.
On test1 repository, nobita has read and write while tom has read permission.
On test2 repository,jerry has read and write while bheem has read permission.

We need to link the access control file with SVN set-up:

sudo nano /etc/apache2/mods-enabled/dav_svn.conf

Just add the following line:

AuthzSVNAccessFile /etc/apache2/svn_access_control

Restart the apache2 service:

sudo /etc/init.d/apache2 restart

To solve this error, we need to enable the authz_svn module:

sudo a2enmod authz_svn

Restart the apache2 service again:

sudo /etc/init.d/apache2 restart

Congratulations! now we have working access control in SVN over Apache2 using authz_svn 🙂

Hope this will help you!

Please Remember me in your prayers!

2 responses to “Access Control in SVN with authz_svn

  1. test2 September 26, 2012 at 12:04 pm

    Hi my loved one! I wish to say that this article is amazing, great written and include almost all significant infos. I’d like to look extra posts like this .

  2. Pingback: Setting up SVN repository on Ubuntu with Apache2 web server | The log of 90 and later

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: