Set up Subversion in Linux with encryption and access rights

Install Subversion:

# apt-get install subversion

Then set up a root directory for repositories:

# mkdir /svn/

Add group “subversion”:

# addgroup subversion

Add User “svn”:

# adduser svn

Add user “svn” to group “subversion”:

# adduser svn subversion

Set permissions:

# chown -R svn:subversion /svn/

Login “svn”:

# su svn

Create a Repository:

# svnadmin create /svn/myrepository

Logout “svn”:

# exit

Customize the configuration file:

# nano /svn/myrepository/conf/svnserve.conf

anon-access = none
auth-access = write
realm = Name_without_spaces
Use-sasl = true
min-encryption = 128
max-encryption = 256

To start the Subversion see

[blog_link=26]identifier=In Linux den Subversion (svnserve) Daemon zur Bootzeit automatisch laden&text=&class=link&role=link[/blog_link]

Sasl install for encryption:

# apt-get install sasl2-bin

Edit configuration file so that sasl is started at boot:

# nano /etc/default/saslauthd


Manually starting

# service saslauthd start

For the encryption works with Subversion

# nano /usr/lib/sasl2/svn.conf

pwcheck_method: auxprop
auxprop_plugin: sasldb
sasldb_path: /etc/svn_sasldb
mech_list: DIGEST-MD5

The file “/etc/svn_sasldb” stores the credentials

Add Users/change

# saslpasswd2 -c -f /etc/svn_sasldb -u Name_without_spaces new_username

Then the prompt comes for the password

Allow access to the file

# chmod 0660 /etc/svn_sasldb
# chown root:subversion /etc/svn_sasldb

Restart sasl

# service saslauthd restart

Set access rights under path:

# nano /svn/myrepository/conf/svnserve.conf

authz-db = authz

# nano /svn/myrepository/conf/authz


admin = user_A
developer = user_A,user_B
visitor = user_A,user_C

@admin = rw
* = r

@developer = rw
@visitor = 

Create subdir in Repository

# svn mkdir file:///svn/myrepository/new_dir

How to access the repository:

Use the address “svn://serveraddress/myrepository“.

Leave a Reply

Your email address will not be published. Required fields are marked *