简体   繁体   中英

how can I set permission for users with multiple repositories each, on svn?

I am using svn and I have this doubt, I install svn server (normal way) and I created the repo with svnadmin create project right now im using linux users to access them with the following protocol

svn+ssh://user@serverip/project

it works fine if I want only one user with one project, if not, i have to create groups, assign the users to the group and give it permission to the folder with a chmod manually

I checked modifying authz and passwd files (on the /config folder) but nothing.

Any idea what would be the right way to set the repositories, users and permissions?

Thanks.

When doing svn+ssh authentication where each user has their own user account on the server, and you want them all to have read/write access then you will need to:

  • Create a group that the users can belong to (svn-groupname)
  • chmod -R 770 /var/svn/reponame
  • chmod -R g+s /var/svn/reponame
  • chgrp -R svn-groupname /var/svn/reponame

I strongly suggest that you formalize this by:

  • Naming your repositories in a consistent manner. Such has having all the repositories where the users are part of the same group have a consistent prefix. That lets you apply permissions using wildcards.
  • Create a /usr/local/sbin shell script (svn_set_repository_permissions.sh) to do the permission setting. This lets you just run a single script later if the permissions get messed up or you add new repositories.
  • Deciding whether you want to use 700 (user-only), 750 (user write, group read), 770 (user and group write), or some other permission set.

If you are doing both svn+ssh authentication plus http authentication, then you'll have to open up the permissions a lot more and use the SVN authorization files instead to restrict users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM