配置SVN权限报错了,如何修改

报错图片:

报错图片mac图片
废了3个小时才搞定找到原因:
1.注意更改svnserve.conf配置文件需要重启svn,更高authz和passwd不需要重启svn。重启方法:pkill svnserve(killall svnserve) 然后重新svnserve -d -r 项目目录即可。
2.一个组group可以包含一个和多个用户,其中用户名必须在用户配置文件中已经定义。
可以将指定具体组,比如开发组和运维组等。

3. 版本库目录格式为 :
[版本库:/项目/目录]
用户名 = 权限
@组名 = 权限

[aliases]
joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
#这里实现了别名的定义
[groups]
team0=zhangsan #将上面创建的分成两个组
team1=lisi

[repo0:/]
@team0=r
@team1=rw

第一个小组只有读取的权限
第二个小组有读写的权限
还有重要一点上面的小组名必须和下面的分组权限名一致,小组名可以任意添加,但下面路径分权限必须有至少一个的完全正确的小组名加r或rw,这也是我犯过的错

这里着重说明下,参数前面不要有空格,否则启动报错,后面也不要加空格,上面的错误就有一部分原因是结尾加空格,SVN一直报错无法使用,提示配置文件错误。

在网上搜集的SVN配置其他文件的知识也加入:

  1. 修改svnserve.conf并重启svn
    vi svnserve.conf 主要修改如下参数,其他不需要修改:
    anon-access = none
    auth-access = write
    password-db = passwd #这个文件可以统一指定一个passwd文件便于统一管理不需要单独每个版本库单独配置。
    authz-db = authz #这个文件可以统一指定一个authz文件便于统一管理不需要单独每个版本库单独配置。
[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
### 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.
### Uncomment the line below to use the default password file.
password-db = passwd #密码文件为当前目录下的passwd
### The authz-db option controls the location of the authorization
### 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
这里着重说明下,参数前面不要有空格,否则启动报错。

2.修改passwd文件:
[users]
zhangsan = 123456
lisi = 123456
前边是svn账号,后边是密码,密码是明文存储。配置哪些用户可以授权使用,里边包含用户名和密码。

导入,导出工程:
$ mkdir MyProject
$ mkdir MyProject/hehe
$ mkdir MyProject/haha
svn import MyProject svn://127.0.0.1/repo0/MyProject -m “first import project”
svn://127.0.0.1/repo0/MyProject

猜你喜欢

转载自blog.csdn.net/weixin_42571463/article/details/85082392