Subversion : Set Access Permission2020/03/27 |
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]
redhat = password
cent = password fedora = password
[root@dlp ~]#
vi /var/svn/repos/project/conf/authz # set groups and users [groups]
developer = redhat,cent
# allow read/write on SVN document-root for developer group [/] @developer = rw # allow read on [trunk] folder for fedora user [/trunk] fedora = r |
[2] | Verify settings to access via SVN to the repository from any remote Hosts. |
[cent@node01 ~]$ svn --username cent list svn://dlp.srv.world/repos/project Authentication realm: <svn://dlp.srv.world:3690> 9444b7fa-df28-4653-9e56-f5bc2b885f75 Password for 'cent': ******** # password you set on [1] ----------------------------------------------------------------------- ATTENTION! Your password for authentication realm: <svn://dlp.srv.world:3690> 9444b7fa-df28-4653-9e56-f5bc2b885f75 can only be stored to disk unencrypted! You are advised to configure your system so that Subversion can store passwords encrypted, if possible. See the documentation for details. You can avoid future appearances of this warning by setting the value of the 'store-plaintext-passwords' option to either 'yes' or 'no' in '/home/cent/.subversion/servers'. ----------------------------------------------------------------------- Store password unencrypted (yes/no)? no branches/ tags/ trunk/
[cent@node01 ~]$
[cent@node01 ~]$ echo 'store-plaintext-passwords = no' >> ~/.subversion/servers
mkdir work [cent@node01 ~]$ cd work [cent@node01 work]$ svn --username cent co svn://dlp.srv.world/repos/project Authentication realm: <svn://dlp.srv.world:3690> 9444b7fa-df28-4653-9e56-f5bc2b885f75 Password for 'cent': ******** A project/branches A project/tags A project/trunk A project/trunk/index.html A project/trunk/testfile.txt A project/trunk/testscript.py A project/trunk/testtool.sh Checked out revision 4.
[cent@node01 work]$
cd project/trunk
# after editing any files under the repository, # try to [commit] with [fedora] user [cent@node01 trunk]$ svn --username fedora ci index.html -m "update by fedora"
Authentication realm: <svn://dlp.srv.world:3690> 9444b7fa-df28-4653-9e56-f5bc2b885f75
Password for 'fedora': ********
svn: E170001: Commit failed (details follow):
svn: E170001: Authorization failed
# denied normally
# [commit] with [redhat] user [cent@node01 trunk]$ svn --username redhat ci index.html -m "update by redhat"
Authentication realm: <svn://dlp.srv.world:3690> 9444b7fa-df28-4653-9e56-f5bc2b885f75
Password for 'redhat': ********
Sending index.html
Transmitting file data .done
Committing transaction...
Committed revision 5.
# could [commit] normally
|
Sponsored Link |