CentOS Stream 8
Sponsored Link

Subversion : Set Access Permission2021/06/18

 
Set Access Permission on SVN repositories. It requires [svnserve] is running.
This setting is not effective to the case you access via [http://] or [file://].
[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> 09a8137a-ff45-4285-b3cb-806282b70600
Password for 'cent': ********   # password you set on [1]

-----------------------------------------------------------------------
ATTENTION!  Your password for authentication realm:

   <svn://dlp.srv.world:3690> 09a8137a-ff45-4285-b3cb-806282b70600

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 ~]$
echo 'store-plaintext-passwords = no' >> ~/.subversion/servers
[cent@node01 ~]$
mkdir work3

[cent@node01 ~]$
cd work3

[cent@node01 work3]$
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
Checked out revision 3.

[cent@node01 work3]$
cd project/trunk
# after creating or editing any files under the repository,

# try to [commit] with [fedora] user

[cent@node01 trunk]$
echo "index.html" > index.html

[cent@node01 trunk]$
svn add index.html

[cent@node01 trunk]$
svn --username fedora ci index.html -m "add new index.html 2021061801"

Authentication realm: <svn://dlp.srv.world:3690> 09a8137a-ff45-4285-b3cb-806282b70600
Password for 'fedora': ********

.....
.....

svn: E170001: Commit failed (details follow):
svn: E170001: Authorization failed
# denied normally as settings

# [commit] with [redhat] user

[cent@node01 trunk]$
svn --username redhat ci index.html -m "add new index.html 2021061801"

Authentication realm: <svn://dlp.srv.world:3690> 09a8137a-ff45-4285-b3cb-806282b70600
Password for 'redhat': ********

Adding         index.html
Transmitting file data .done
Committing transaction...
Committed revision 6.
# done normally as settings

[cent@node01 trunk]$
svn update

[cent@node01 trunk]$
svn list

index.html
test.txt
testfile.txt
Matched Content