SVN认证失败的错误分析
作者:朱金灿
来源:http://blog.csdn.net/clever101
时常碰见SVN认证失败的问题,经过一番思考,可以总结出错误根源是:在SVN的数据库目录下有一个svnserve.conf文件,打开这个文件,里面有这样一行:
# authz-db = authz
如果把这行改为:
authz-db = authz
就意味着svn授权文件为authz。默认授权文件authz的内容是:
### This file is an example authorization file for svnserve. ### Its format is identical to that of mod_authz_svn authorization ### files. ### 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, ### - only anonymous users, using the '$anonymous' token, ### - anyone, using the '*' wildcard. ### ### A match can be inverted by prefixing the rule with '~'. Rules can ### 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 = harry,sally # harry_sally_and_joe = harry,sally,&joe # [/foo/bar] # harry = rw # &joe = r # * = # [repository:/baz/fuz] # @harry_and_sally = rw # * = r
既然你指定了一个授权文件,就得对这个默认的授权文件进行编辑。现在假设你的svn数据为doc,你的用户名为bill,那个这个授权文件就可以改为:
[aliases] # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average [groups] # harry_and_sally = harry,sally # harry_sally_and_joe = harry,sally,&joe # 指定根目录和用户访问权限 [doc:/] bill = rw * =
当然在[groups]字段里你也可以设定组,通过组来进行授权。