Subversion : Set Access Permission2024/09/13 |
Set Access Permission on SVN repositories. It requires [svnserve] is running. |
|
[1] | For example, Set Access Permission to [/home/svn/repos/project] repository. |
root@dlp:~ #
vi /home/svn/repos/project/conf/svnserve.conf # line 9 : add (prohibit anonymous access) [general]
anon-access = none
# line 28 : uncomment password-db = passwd # line 37 : uncomment authz-db = authz
root@dlp:~ #
vi /home/svn/repos/project/conf/passwd # set username and password for this repository [users]
freebsd = password
netbsd = password openbsd = password
root@dlp:~ #
vi /home/svn/repos/project/conf/authz # set groups and users [groups]
developer = freebsd,netbsd
# allow read/write on SVN document-root for developer group [/] @developer = rw # allow read on [trunk] folder for openbsd user [/trunk] openbsd = r |
[2] | Verify settings to access via SVN to the repository from any remote Hosts. |
freebsd@node01:~ $ svn --username freebsd list svn://dlp.srv.world/project
Authentication realm: <svn://dlp.srv.world:3690> 3247b0a6-6571-ef11-b1e8-df8f47688296
Password for 'freebsd': ******** # password set in [1]
branches/
tags/
trunk/
freebsd@node01:~ $
freebsd@node01:~ $ echo 'store-plaintext-passwords = no' >> ~/.subversion/servers
mkdir work3 freebsd@node01:~ $ cd work3 freebsd@node01:~/work3 $ svn --username freebsd co svn://dlp.srv.world/project Authentication realm: <svn://dlp.srv.world:3690> 3247b0a6-6571-ef11-b1e8-df8f47688296 Password for 'freebsd': ******** A project/branches A project/tags A project/trunk Checked out revision 3.
freebsd@node01:~/work3 $
cd project/trunk
# after creating or editing any files under the repository, # try to [commit] with [openbsd] user freebsd@node01:~/work3/project/trunk $ echo "index.html" > index.html freebsd@node01:~/work3/project/trunk $ svn add index.html freebsd@node01:~/work3/project/trunk $ svn --username openbsd ci index.html -m "add new index.html 2024091301"
Authentication realm: <svn://dlp.srv.world:3690> 3247b0a6-6571-ef11-b1e8-df8f47688296
Password for 'openbsd': ********
svn: E170001: Commit failed (details follow):
svn: E170001: Authorization failed
# denied normally as settings
# [commit] with [netbsd] user freebsd@node01:~/work3/project/trunk $ svn --username netbsd ci index.html -m "add new index.html 2024091301"
Authentication realm: <svn://dlp.srv.world:3690> 3247b0a6-6571-ef11-b1e8-df8f47688296
Password for 'netbsd': ********
Adding index.html
Transmitting file data .done
Committing transaction...
Committed revision 4.
# done normally as settings
freebsd@node01:~/work3/project/trunk $ svn update freebsd@node01:~/work3/project/trunk $ svn list index.html |
Sponsored Link |
|