svnserve集成LDAP认证配置
<h4>svnserve集成LDAP认证配置</h4>
<ul>
<li><strong>一、环境准备</strong></li>
</ul>
<p>1、两台LInux服务器,我这里使用的是CentOS6.5的系统</p>
<p>2、关闭SELINUX和防火墙</p>
<pre><code class="language-bash">#修改selinux配置文件
#临时关闭:
[root@localhost ~]# getenforce
Enforcing
[root@localhost ~]# setenforce 0
[root@localhost ~]# getenforce
Permissive
#永久关闭:
[root@localhost ~]# vim /etc/sysconfig/selinux
SELINUX=enforcing 改为 SELINUX=disabled
reboot #重启服务器,视情况而定,建议先设置临时的,再设置永久
#查看防火墙运行状态
# /etc/init.d/iptables status
# chkconfig iptables off</code></pre>
<ul>
<li><strong>二、LDAP协议认证</strong></li>
</ul>
<pre><code class="language-bash">#安装Cyrus SASL相关组件
yum install –y subversion cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain
#查看sasl版本和提供的验证模块信息
saslauthd -v
#修改SASL的用户验证方式为LDAP
cp /etc/sysconfig/saslauthd /etc/sysyconfig/saslauthd.save #保存配置文件
sed –I ‘s/MECH=pam/MECH=ldap/g’ /etc/sysconfig/saslauthd
#修改SASL的配置文件/etc/saslauthd.conf,如果配置文件不存在就新建一个
vim /etc/saslauthd.conf
#填写ldap协议的各个要素
ldap_servers:ldap://paxsz.local
ldap_default_domain:paxsz.local
ldap_search_base:OU=百富公司,DC=paxsz,DC=local
ldap_bind_dn:paxsz\cmadmin
ldap_password:password
ldap_deref:never
ldap_restart:yes
ldap_scope:sub
ldap_use_sasl:no
ldap_start_tls:no
ldap_version:3
ldap_auth_method:bind
ldap_mech:DIGEST-MD5
ldap_filter:sAMAccountName=%u
ldap_password_attr:userPassword
ldap_timeout:10
ldap_cache_ttl:30
ldap_cache_mem:32786
#此处是填写的LDAP协议的各个要素
#重启SASL服务,测试配置文件是否正确,与AD连接能否成功
service saslauthd restart
testsaslauthd –u huangwj
#修改SVN的SASL配置文件/etc/sasl2/svn.conf,如果配置文件不存在就新建一个
vim /etc/sasl2/svn.conf
pwcheck_method:saslauthd #用户验证方法
mech_list:plain loain #用户验证信息怎么传输
#修改版本库的conf配置
vim /data/svnroot/test/conf/svnserve.conf
[general]
# 注释掉password-db
#password-db = passwd
[sasl]
use-sasl = true #开启sasl用户验证
#重启SVN服务,测试一下
killall svnserve
svnserve</code></pre>