前几天设置了一下svn的权限, 昨天上网查了半天,实验了几十次都没有成功,今天读了读配置文件的说明很快搞定,
工作这许多年了,还是要有做事的方法,不要总是在试错中做事,闲言少叙, 书归正传,步骤如下
svn仓库建立不再赘叙,svn仓库下面conf文件夹存放系统权限设置文件,分别为authz passwd svnserve.conf
下面一一分析
对照对文件的翻译, 设置一下, 其中我设置两个用户 test 只读权限, test1 读写权限
svnserve.conf 配置设置文件
### This file controls the configuration of the svnserve daemon, if you
svnerve守护进程的控制配置文件, 使用它来访问版本仓库,
如果你只通过http: 和/或 file: 访问,则这个文件是无关的。
### use it to allow access to this repository. (If you only allow
### access through http: and/or file: URLs, then this file is
### irrelevant.)
### Visit for more information.
获取更多信息
[general]
### These options control access to the repository for unauthenticated
这些选项控制授权用户和未授权用户的权限。合法的权限又“写”、“读”、“无”
### and authenticated users. Valid values are "write", "read",
### and "none". The sample settings below are the defaults.
#如下例子是默认的权限,未授权用户不可读写
anon-access = none
##授权用户访问可写
auth-access = write
### The password-db option controls the location of the password
password-db选项通控制密码数据库文件的存放位置。
### database file. Unless you specify a path starting with a /,
除非你通过/设置文件位置,否则末日密码数据库文件和此设置文件同样目录
### the file's location is relative to the directory containing
### this configuration file.
### If SASL is enabled (see below), this file will NOT be used.
如果使用SASL认证机制,则此文件无效。
### Uncomment the line below to use the default password file.
下面为默认的密码数据文件
password-db = passwd
### The authz-db option controls the location of the authorization
authz-db 选项控制访问权限。
### rules for path-based access control. Unless you specify a path
除非你通过/设置文件位置,否则末日密码数据库文件和此设置文件同样目录
### starting with a /, the file's location is relative to the the
### directory containing this file. If you don't specify an
如果你不设置此项,访问权限控制将无效
### authz-db, no path-based access control is done.
### Uncomment the line below to use the default authorization file.
下面为默认的权限设置文件
authz-db = authz
#此后设置目前无用
…… ……
…… ……
authz文件分析:
### This file is an example authorization file for svnserve.
这个文件是svnserve权限管理的一个例子
### Its format is identical to that of mod_authz_svn authorization
### files.
#格式和mod_authz_svn 文件一致
### As shown below each section defines authorizations for the path and
如下每段通过段名定义了权限
### (optional) repository specified by the section name.
### The authorizations follow. An authorization line can refer to:
权限行可以指代如下内容:
### - a single user,
单一用户
### - a group of users defined in a special [groups] section,
组用户
### - an alias defined in a special [aliases] section,
别名
### - all authenticated users, using the '$authenticated' token,
所有授权用户,使用$authenticated标记
### - only anonymous users, using the '$anonymous' token,
仅仅匿名用户, 使用$anonymous' 标记
### - anyone, using the '*' wildcard.
任何人, 使用* 通配符
###
### A match can be inverted by prefixing the rule with '~'. Rules can
只读权限 'r', 读写权限 'rw', 或者不许访问 ''
### grant read ('r') access, read-write ('rw') access, or no access
### ('').
#别名
[aliases]
# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
#组用户
#[groups]
#harry_and_sally = test
# harry_sally_and_joe = harry,sally,&joe
# [/foo/bar]
# harry = rw
# &joe = r
# * =
#
#仓库根路径,用户test 可读, test1可读写
[/]
test = r
test1 = rw
# [repository:/baz/fuz]
# @harry_and_sally = r
# * = r
passwd文件分析:
### This file is an example password file for svnserve.
这是一个svnserve 密码文件的例子
### Its format is similar to that of svnserve.conf. As shown in the
它的格式和svnserve.conf相同.
### example below it contains one section labelled [users].
下面这包含 [users] 的标签
### The name and password for each user follow, one account per line.
用户名和密码如下,每行一个用户
[users]
# harry = harryssecret
# sally = sallyssecret
test = test123
test1 = 123
阅读(1840) | 评论(0) | 转发(0) |