How do I add a user in SVN?

Subversion authentication typically has two parts. The first is a password repository of some kind. The second is an access control list. The password list is used to authenticate users and check their passwords, but you also have to set which users have access to which resources.

There are several password repository types. I am not familier with the passwd type, I use the htpasswd type that uses the same user/password files that apache does for user authentication. I add users to this file with htpasswd .htpasswd username. It looks like you may have done this step correctly for your password type.

The second part is the ACL. Subversion should have a file called access somewhere with sections for each of your repositories. You will need to add a line under the repository you want to access with username = rw to give that user read/write access to that repository.


SVN server configuration (mainly) consists of three files:

  • authz
  • passwd
  • svnserve.conf This is the main file (authz-db = authz)

So you just provide us with two config files, please check that the authz file contains:

#[the_name_of_repository:/path_in_that_repository]
[test:/]
user1 = rw
user2 = rw

for the project test you whant to grant access


## Create testuser ##
htpasswd -m /etc/svn-auth-users testuser

New password:

Re-type new password:

Adding password for user testuser2

Note: Use exactly same file and path name as used in the subversion.conf file. This example uses /etc/svn-auth-users file.

Tags:

Subversion