3

I use Debian 7 and have Subversion installed.

I can't figure out what permissions and owners to set to the repositories once I create them.

I want to have 2 types of repositories:

1) svn/private/* - only one specified user can read&write

2) svn/public/* - only a specified user group can read&write here

* means multiple repos there

I want all users to be taken from the Linux system, not specified in passwd file or something. So how do I set the repositories permissions (talking about linux permissions) properly to achieve that?

Also for the public repositories it should be possible for the authorized users to commit and this not to break the repos (because I had such a problem before).

We are talking about svn+ssh access only.

I have read lots of tutorials on the internet but none of them have what I need.

Can you help me?

1

Using svn+ssh to connect to a subversion repository simply uses the standard unix file permissions on the files in the repository as the user has, effectively, connected to the remote server via ssh and is simply running the svn command locally on said server.

If user x has read/write permission to those file, then user x can commit changes to that repository. If user y does NOT have permission to read/write to those files, then user y cannot commit changes or, if they do not have read access either, even view (check out) the contents of the repository.

In the simplest mode, use chown and chmod to set the ownership and permissions on a repository for each user:

$chown user:group /wherever/svn/private
$chmod 770 /wherever/svn/private

and so on.

For more complicated permissions, one must use the svn through an http server and use the access controls for the http server to access specific paths within a repository.

NOTE: If a user has read/write access to a specific repository, they can damage it. So, as long as you're using svn+ssh, you are granting considerable access to those users. Now, even in more restricted situations, as long as a user can commit changes to a repo, they can do damage.... though usually that damage can be rolled back.

Give me a minute and I'll link to the relevant chapter in the SVN documentation.

Here's the section on svn+ssh configuration

Here's the section on HTTP configuration

The take-away from the book is that svn+ssh is simple and secure but limited, and http is much more capable, but more complex. I pretty much just use the HTTP method to provide pretty read only access to those I want to, and everyone else gets access through svn+ssh and I severely limit who those people are and backup alot. I've never even tried the svnserve method so far as I can recall.

  • I read somewhere that svnserve must be used and it should do the commits for the users. So if it acts like a root, users don't have ssh access to the repo files, but can commit. It sounds good but I don't know how to configure it that way. – barakuda28 Sep 24 '13 at 14:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.