Subversion : Set Access Permission2024/07/24 |
Set Access Permission on SVN repositories. It requires [svnserve] is running. |
|
[1] | For example, Set Access Permission to [/var/svn/repos/project] repository. |
root@dlp:~#
vi /var/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 /var/svn/repos/project/conf/passwd # set username and password for this repository [users]
ubuntu = password
noble = password debian = password
root@dlp:~#
vi /var/svn/repos/project/conf/authz # set groups and users [groups]
developer = ubuntu,noble
# allow read/write on SVN document-root for developer group [/] @developer = rw # allow read on [trunk] folder for debian user [/trunk] debian = r |
[2] | Verify settings to access via SVN to the repository from any remote Hosts. |
ubuntu@node01:~$ svn --username ubuntu list svn://dlp.srv.world/repos/project
Authentication realm: <svn://dlp.srv.world:3690> 84792bc8-15d0-4409-8573-be73eacd8478
Password for 'ubuntu': ******** # password you set on [1]
branches/
tags/
trunk/
ubuntu@node01:~$
ubuntu@node01:~$ echo 'store-plaintext-passwords = no' >> ~/.subversion/servers
mkdir work3 ubuntu@node01:~$ cd work3 ubuntu@node01:~/work3$ svn --username ubuntu co svn://dlp.srv.world/repos/project Authentication realm: <svn://dlp.srv.world:3690> 84792bc8-15d0-4409-8573-be73eacd8478 Password for 'ubuntu': ******** A project/branches A project/tags A project/trunk Checked out revision 3.
ubuntu@node01:~/work3$
cd project/trunk
# after creating or editing any files under the repository, # try to [commit] with [debian] user ubuntu@node01:~/work3/project/trunk$ echo "index.html" > index.html ubuntu@node01:~/work3/project/trunk$ svn add index.html ubuntu@node01:~/work3/project/trunk$ svn --username debian ci index.html -m "add new index.html 2024072401"
Authentication realm: <svn://dlp.srv.world:3690> 84792bc8-15d0-4409-8573-be73eacd8478
Password for 'debian': ********
svn: E170001: Commit failed (details follow):
svn: E170001: Authorization failed
# denied normally as settings
# [commit] with [noble] user ubuntu@node01:~/work3/project/trunk$ svn --username noble ci index.html -m "add new index.html 2024072401"
Authentication realm: <svn://dlp.srv.world:3690> 84792bc8-15d0-4409-8573-be73eacd8478
Password for 'noble': ********
Adding index.html
Transmitting file data .done
Committing transaction...
Committed revision 4.
# done normally as settings
ubuntu@node01:~/work3/project/trunk$ svn update ubuntu@node01:~/work3/project/trunk$ svn list index.html |
Sponsored Link |