0113 subversion svn 安全认证

写了一些代码,想提交的时候,以前都是用的FILE://,现在用 svn://localhost/sftools 出现问题:
>%SVN_HOME%\\bin\\svn commit –message "Some damn fool msg"
svn: Commit failed (details follow):
svn: Connection is read-only

看到很多人也在问这个问题

The answer is that svnserve defaults anonymous access to read-only as configured in the conf/svnserve.cnf file in the Repository.

Did you enable write access in svnserve.conf (in the conf/ directory of your repository)? It defaults to read-only access.

看到 SUBVERSION系统学习笔记
Subversion服务器有两种运行方式,一是可以作为Apache 2.0的一个模块,以WebDAV/DeltaV协议与外界连通;另外,也可使用Subversion 自带的小型服务器程序svnserve。该程序使用的是自带的通讯协议,可以很容易地透过SSH以以http方式运行
以svnserve方式运行
这种方式的运行又可以分为以下两种(这和vsftp有些相似)
1) standalone mode 2) xinetd mode

客户机的访问方法舆服务器的运行方式有直接关系
window客户机:
1) 服务器以http方式运行

2) 服务器以svnserve方式运行
同上的区别只是URL of repository变为 svn://svn服务器ip/home/mysvn
或者 svn+ssh://svn服务器ip/home/mysvn

作者简介
姓名:雷凯
工作单位:升技主板(苏州)研发中心
联系地址:苏州市新区马运路罗礼科技有限公司研发中心 邮编 215000
E-mail: tigerleihm@yahoo.com.cn

服务器以svnserve方式运行
默认下客户可以以匿名方式通过svn://方式任意访问档案库,为了限制其权限,比如只允许读操作,可以通过修改档案库conf子目录中的svnseve.conf文件来实现。
#vi /home/mysvn/conf/svnseve.conf
修改[general]字段下内容为:
anon-access = read
如果设为anon-access = none,则匿名用户不可以通过svn://方式访问档案库
为了实现用户认证,我们一般采用svn+ssh://访问机制。
首先在svnseve.conf文件设置anon-access = none禁止匿名用户通过svn://方式访问档案库,然后在其后加入
auth-access = write
auth-access 是限制有援权的使用者(使用svn+ssh:// 来登入) 的存取权限,我们设为是可以读写。

SVN有3种常用访问方式。通过file://, svn://,http:// 等不同的协议来访问。对于协作开发,这三种都可以胜任:如果在同一局域网内,可通过windows的文件共享协议来访问其他机器上的文件,例如file://server/d/svnrepo。svn协议使用3690端口,如果防火墙无法打开端口,可与Apache整合使用http协议。

使用版本控制必须要进行权限控制,svn协议的权限控制可通过ssh来控制,访问协议则改为:svn+ssh://localhost/,windows下这种方式需要安装ssh客户端。
另一种简易的版本控制为使用passwd文件。修改%REPO_HOME%/conf/ svnserve.conf,包含如下几句:
    [general]
    # 指定匿名可读,授权后才可写入
    anon-access = read
    auth-access = write
    # 指定密码文件为当前目录下passwd
    password-db = passwd
 
Passwd文件内容如下,用户名 = 密码:
    [users]
    user1 = 123456

[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 = read,write
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 conf directory.
### Uncomment the line below to use the default password file.
password-db = passwd

[users]
sf=sf

历史博文

标签:, ,
三月 3, 2006 at 10:50 下午 by yippee 1,033 次
Category: Dev
Tags: , ,