我将在我的 svn 服务器上创建一个新用户,该用户只能在我的一个存储库中访问。这是可能的?
我的服务器运行 debian 挤压。
您可以使用 svn authz 文件设置权限。首先,我们需要创建一个访问控制文件。
sudo nano /etc/apache2/svn_access_control
用户组
您可以创建用户组,然后将其用于规则。您可以在方括号中的特殊标题下执行此操作:
[groups]
mygroup = dave, mike
这将创建一个名为“mygroup”的组,“dave”和“mike”属于该组。
现在举一些例子。例子
[groups]
team = bob, bill devteam = bob, barry, brett
[/]
@team = r bob = rw
[/wowapp/trunk]
@team = r @devteam = rw brenda = rw
在这个例子中:
Created a group team which has two members; bob and bill.
Created another group, called devteam which has three members; bob, barry, brett.
In the root of the repository, I’ve given the group team read permissions.
Also, in the root, bob has read and write permissions.
In the trunk of wowapp, the group team has read permission.
Also, the devteam group has read and write permissions.
And another user, called brenda has read and write permissions.
您需要在 apache svn 配置文件中添加以下行。
AuthzSVNAccessFile /etc/apache2/svn_access_control
使文件看起来像这样:
<Location /svn>
DAV svn
SVNPath /home/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
AuthzSVNAccessFile /etc/apache2/svn_access_control
Require valid-user
</Location>
保存文件,然后重新启动 Apache2:
sudo /etc/init.d/apache2 restart
您现在应该可以通过 Apache2 对 Subversion 进行访问控制。