1、找到SVN安装路径

[root@localhost conf]# pwd

/home/svn/conf

2、文件说明

[root@localhost conf]# ll

total 12
-rw-r--r-- 1 root root 1517 May 25 11:37 authz  //用户权限配置
-rw-r--r-- 1 root root  569 May 25 11:28 passwd //用户名密码配置

-rw-r--r-- 1 root root    0 May 10 11:47 svn_dump

-rw-r--r-- 1 root root 3070 Nov  9  2017 svnserve.conf

3、先添加用户信息

[root@localhost conf]# vi passwd 
      1 ### This file is an example password file for svnserve.
      2 ### Its format is similar to that of svnserve.conf. As shown in the
      3 ### example below it contains one section labelled [users].
      4 ### The name and password for each user follow, one account per line.
      5 
      6 [users]
      7 # harry = harryssecret
      8 # sally = sallyssecret

      9 admin=msllf //用户名=密码

4、添加权限信息

[root@localhost conf]# vi authz 

      1 ### This file is an example authorization file for svnserve.
      2 ### Its format is identical to that of mod_authz_svn authorization
      3 ### files.
      4 ### As shown below each section defines authorizations for the path and
      5 ### (optional) repository specified by the section name.
      6 ### The authorizations follow. An authorization line can refer to:
      7 ###  - a single user,
      8 ###  - a group of users defined in a special [groups] section,
      9 ###  - an alias defined in a special [aliases] section,
     10 ###  - all authenticated users, using the '$authenticated' token,
     11 ###  - only anonymous users, using the '$anonymous' token,
     12 ###  - anyone, using the '*' wildcard.
     13 ###
     14 ### A match can be inverted by prefixing the rule with '~'. Rules can
     15 ### grant read ('r') access, read-write ('rw') access, or no access
     16 ### ('').
     17 
     18 [aliases]
     19 # joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average
     20 
     21 [groups]
     22 # harry_and_sally = harry,sally
     23 # harry_sally_and_joe = harry,sally,&joe
     24 
     25 # [/foo/bar]
     26 # harry = rw
     27 # &joe = r
     28 # * =
     29 
     30 # [repository:/baz/fuz]
     31 # @harry_and_sally = rw
     32 # * = r
     33 [/] //访问路径权限

     34 admin=rw //用户 r读权限 w写权限

5、重启svn服务

[root@localhost conf]# killall svnserve //杀死svn服务进程

[root@localhost conf]# svnserve -d -r /home/svn/ //启动svn服务

Logo

更多推荐