I want to add a user in svn on an Ubuntu machine, how would I go about doing that?
4 Answers
In your SVN repo (note: not the checkout) there is a directory called "conf
". In that directory are a few files that control users and their access to the repo:
svnserve.conf
passwd
authz
Read the notes at the top of those files and you should be able to add a new user and configure their read/write access to the repo.
In case you are using HTTP/WebDAV access:
- Locate the htpasswd file you use for listing users. This path can be found in the apache configuration for your server - grep for the word AuthUserFile.
- Enter htpasswd thepathtothatfile theusernametoadd
- When prompted enter the new password for the user, and repeat it to confirm.
- Now restart/graceful the apache instance controlling your repository (propably something like apache2ctl -k graceful
The user should now be active on the repository. If you also have per-directory access control set up, follow these steps as well:
- Locate your per-directory permissions file - grep your apache config for the term AuthzSVNAccessFile ; this will give you the path (if it is set).
- Either add a directory to the file ([/directory/from/root/of/repo]), or select an existing entry.
- Add that user underneath the appropriate entry, specifying rw for full access, or r for read-only.
Here is a sample per-directory access file:
[/]
admin = rw
[/project/trunk]
sarah = rw
mike = r
Go to conf Directory in your repo
Open svnserver.conf and uncomment/add these lines if they are already not.
anon-access = read
auth-access = write
password-db = passwd
Open file named passwd in conf directory to add users, one way to add users easily is to add a line for the new user account in the format "user=password" (no quotes) to the file
Hope that helps .. :)
Thanks,
Mahesh Velaga.
I found a few examples that does what you want. It does however depend on how subversion was installed (web or no web).
http://www.howtoforge.com/subversion-trac-virtual-hosts-on-ubuntu-server