13

UPDATE #3: I think I found it.
/etc/httpd/conf.d/subversion.conf

<Location /repos>
        DAV svn
        SVNPath /var/www/svn/repos
        AuthType Basic
        AuthName "Subversion repos"
        AuthUserFile /etc/svn-auth-conf
        Require valid-user
</Location>

svn-auth-conf is in the format of

user1:$apr1$randome letters ... $random letters and numbers

I feel like I used some command line tool to add the users but I can't remember what.

UPDATE #2: locate http.conf gives these results

/usr/share/logwatch/default.conf/logfiles/http.conf
/usr/share/logwatch/default.conf/services/http.conf

I don't see anything in either of them that looked related to subversion. I can post the files here if it will help.

original question:

A few years ago, I installed and setup subversion. I don't remember how I added a user. I need to add another now, but when I checked the passwd file there were no users defined, nor was there anything set in the svnserve.conf file -- both had everything commented out. That is the only way I can find to add users via google. So I tried it:

passwd

user1 = password1
user2 = password2

svnserve.conf

anon-access = none
auth-access = write
pasword-db = passwd
authz-db - authz
realm = repos

but I can still only access it with user1, even though user1 is not a user on the linux server. Is there some other way to add users or do I have something wrong in my configuration?

update:

I've added the following line to my svnserve.conf file

authz-db = authz

then my authz file looks like this

authz [groups] devs = user1,user2

[repos:/]
devs = rw

still doesn't work. the password for user1 is different in the passwd than I use to login. So i think that subversion is not using that for authentication at all. especially since the file was empty before and I was still able to login. is there any way to make sure it uses the svnserve,passwd,authz files for authentication? is there another config file somewhere?

0

5 Answers 5

8

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.

2
  • i'll give it a try when I get home. that sounds familiar.
    – scott
    Jul 1, 2011 at 11:12
  • I don't think this is it. there was no .htpasswd file on my server.
    – scott
    Jul 2, 2011 at 4:20
6

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

9
  • I tried this it didn't work. the password i use to log in as user1 is different than the one i have in the passwd file. so I don't think it is using it at all.
    – scott
    Jul 2, 2011 at 4:19
  • please, check that you are using the right configuration file: what is the output for ps aux|grep svn
    – Sergey
    Jul 2, 2011 at 7:33
  • And one more question. How do you get your repos directory structure (svn:// or throught http server)?
    – Sergey
    Jul 2, 2011 at 7:35
  • root 19578 0.0 0.3 4016 664 tty1 R+ 05:15 0:00 grep svn
    – scott
    Jul 2, 2011 at 13:29
  • through http server
    – scott
    Jul 2, 2011 at 13:30
4
## 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.

2
htpasswd -m /etc/subversion/svn-auth-file yourusername

It will then ask for the password and confirm password.

1

you can use command,

sudo htpasswd -cm /etc/apache2/dav_svn.passwd XXXXX
  • XXXXX been the user name, then it will ask for the password

this is only if you setup svn with apache, which don't read svn conf folders user name password conf files

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .