How do I add a user in SVN?

  • 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?

  • Caleb

    Caleb Correct answer

    9 years ago

    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.

    i'll give it a try when I get home. that sounds familiar.

    I don't think this is it. there was no .htpasswd file on my server.

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM