svn使用openldap验证apache访问方式
启用svn服务器的sasl验证机制
1、安装cyrus-sasl认证包
# yum install -y *sasl*
# rpm -qa|grep sasl
cyrus-sasl-2.1.23-15.el6_6.2.x86_64
ruby-saslwrapper-0.14-1.el6.x86_64
cyrus-sasl-md5-2.1.23-15.el6_6.2.x86_64
cyrus-sasl-lib-2.1.23-15.el6_6.2.x86_64
cyrus-sasl-devel-2.1.23-15.el6_6.2.x86_64
cyrus-sasl-gssapi-2.1.23-15.el6_6.2.x86_64
saslwrapper-0.14-1.el6.x86_64
cyrus-sasl-sql-2.1.23-15.el6_6.2.x86_64
python-saslwrapper-0.14-1.el6.x86_64
cyrus-sasl-ldap-2.1.23-15.el6_6.2.x86_64
cyrus-sasl-ntlm-2.1.23-15.el6_6.2.x86_64
cyrus-sasl-plain-2.1.23-15.el6_6.2.x86_64
saslwrapper-devel-0.14-1.el6.x86_64
2、修改sasl认证模式为shadow
# cp /etc/sysconfig/saslauthd /etc/sysconfig/saslauthd.bak.$(date +%F%T)
[root@node5 config]# ll /etc/sysconfig/saslauthd*
-rw-r--r-- 1 root root 553 Feb 27 2015 /etc/sysconfig/saslauthd
-rw-r--r-- 1 root root 553 Jul 1 21:14 /etc/sysconfig/saslauthd.bak.
-rw-r--r-- 1 root root 553 Jul 1 21:14 /etc/sysconfig/saslauthd.bak.2016-07-0121:14:19
[root@node5 config]# sed -i 's#MECH=pam#MECH=shadow#g' /etc/sysconfig/saslauthd
[root@node5 config]# grep -i mech /etc/sysconfig/saslauthd
# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
MECH=shadow
# Options sent to the saslauthd. If the MECH is other than "pam" uncomment the next line.
3、配置ldap方式验证用户
# /etc/init.d/saslauthd restart
Stopping saslauthd: [FAILED]
Starting saslauthd: [ OK ]
[root@node5 config]# testsaslauthd -ulily -plily
0: NO "authentication failed"
[root@node5 config]# grep lily /etc/passwd
[root@node5 config]# id lily
id: lily: No such user
[root@node5 config]# useradd lily
[root@node5 config]# passwd lily
Changing password for user lily.
New password:
BAD PASSWORD: it is too short
BAD PASSWORD: is too simple
Retype new password:
passwd: all authentication tokens updated successfully.
[root@node5 config]# testsaslauthd -ulily -plily
0: OK "Success."
# testsaslauthd -utom -ptom
0: NO "authentication failed"
修改验证模式为ldap
# sed -i 's#MECH=shadow#MECH=ldap#g' /etc/sysconfig/saslauthd
[root@node5 config]# grep -i mech /etc/sysconfig/saslauthd
# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
MECH=ldap
# Options sent to the saslauthd. If the MECH is other than "pam" uncomment the next line.
编辑saslauthd.conf文件,默认不存在,需要自己添加
vim /etc/saslauthd.conf 加入如下内容:
ldap_servers: ldap://chinasoft.com/
ldap_bind_dn: cn=admin,dc=chinasoft,dc=com
ldap_bind_pw: chinasoft
ldap_search_base: ou=People,dc=chinasoft,dc=com
ldap_filter: uid=%U
ldap_password_attr: userPassword
# /etc/init.d/saslauthd restart
Stopping saslauthd: [ OK ]
Starting saslauthd: [ OK ]
# testsaslauthd -ulily -plily
0: OK "Success."
[root@node5 config]# testsaslauthd -utom -ptom
0: OK "Success."
4、配置svn通过ldap验证
在ldap服务器中添加svn.conf文件,默认没有该文件,需要自己添加
# vim /etc/sasl2/svn.conf
pwcheck_method: saslauthd
mech_list: PLAIN LOGIN
svn服务器中修改svn服务器配置
# cd /application/svndata/sadoc/conf/
# sed -i 's@# use-sasl = true@use-sasl = true@g' svnserve.conf
# grep use-sasl svnserve.conf
use-sasl = true
[root@node2 conf]# /etc/init.d/svnserve stop
[root@node2 conf]# pkill svnserve
[root@node2 conf]# lsof -i :3690
启动服务
[root@node2 conf]# svnserve -d -r /application/svndata/
[root@node2 conf]# lsof -i :3690
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
svnserve 35415 root 3u IPv4 557724 0t0 TCP *:svn (LISTEN)
修改svn服务器apache配置
# vim /etc/httpd/confhttpd.conf
<Location /svn>
# SVN配置
DAV svn
SVNPath /application/svndata/sadoc/
SVNListParentPath on
AuthType Basic
AuthName "svn for project"
AuthUserFile /application/svnpasswd/webpasswd
AuthzSVNAccessFile /application/svnpasswd/authz
Satisfy all
Require valid-user
# 在ldap找不到账号的情况下可以使用其它的认证方式(如,密码文件)
AuthzLDAPAuthoritative off
# openLDAP的管理账户
AuthLDAPBindDN "cn=admin,dc=chinasoft,dc=com"
AuthLDAPBindPassword chinasoft
AuthBasicProvider ldap
# 认证数据来源:"ou=People,dc=chinasoft,dc=com" 下所有子entity的uid作为认证用户名
AuthLDAPURL "ldap://192.168.8.43:389/ou=People,dc=chinasoft,dc=com?uid?sub?(objectClass=*)"
# 设置目录权限,实现列表所有工程目录
Options Indexes FollowSymLinks
Order allow,deny
Allow from all
</Location>
查看错误日志定位问题:
# tail /var/log/httpd/error_log
[Tue Jul 05 14:40:18 2016] [error] [client 192.168.50.122] user lily: authentication failure for "/svn/": Password Mismatch
[Tue Jul 05 14:40:23 2016] [notice] caught SIGTERM, shutting down
[Tue Jul 05 14:40:23 2016] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Tue Jul 05 14:40:23 2016] [notice] Digest: generating secret for digest authentication ...
[Tue Jul 05 14:40:23 2016] [notice] Digest: done
[Tue Jul 05 14:40:23 2016] [notice] Apache/2.2.15 (Unix) DAV/2 SVN/1.6.11 configured -- resuming normal operations
[Tue Jul 05 14:40:26 2016] [error] [client 192.168.50.122] user lily: authentication failure for "/svn/": Password Mismatch
[Tue Jul 05 14:40:38 2016] [error] [client 192.168.50.122] user lily: authentication failure for "/svn/": Password Mismatch
[Tue Jul 05 14:40:40 2016] [error] [client 192.168.50.122] File does not exist: /var/www/html/favicon.ico
[Tue Jul 05 14:40:45 2016] [error] [client 192.168.50.122] user lily: authentication failure for "/svn/": Password Mismatch
svn通过ldap验证小结:
1.配置成功saslauthd
2.在ldap服务器中配置/etc/sasl2/svn.conf
3.配置好svn服务,并且开启sasl支持,重启svn
4.配置authz授权ldap用户访问项目
5.配置httpd.conf授权通过ldap访问
注意:
通过ldap认证的用户,必须在svn和ldap中添加相同账号,并且密码必须一致,否则无法访问
svn使用openldap验证apache访问方式的更多相关文章
- SVN服务的模式和多种访问方式 多种访问原理图解与优缺点
SVN企业应用场景 SVN任是当前企业的主流.git正在发展,未来会成为主流.如果大家精力足够,建议同时掌握. 1.4运维人员掌握版本管理 对于版本管理系统,运维人员需要掌握的技术点: 1.安装.部署 ...
- CentOS搭建SVN服务器,并通过Apache HTTP方式访问
摘要:本文主要讲述了在centos 6.5环境下搭建svn服务器,可通过svn:\\IP方式访问.同时由于部分公司内网端口限制,并不能访问外网的svn服务器,所以特地结合了apache服务器,使得可以 ...
- Centos虚拟机SVN的安装和使用http方式访问svn服务器
1.查看是否安装旧版SVNrpm -qa | grep subversion2.卸载旧版本SVNyum remove subversion3.安装SVNyum -y install subversio ...
- 在APACHE服务器上的访问方式上去除index.php
在APACHE服务器上的访问方式上去除index.php 下面我说下 apache 下 ,如何 去掉URL 里面的 index.php 例如: 你原来的路径是: localhost/index ...
- svn的安装(整合apache、ldap)包括错误解决post commit FS processing had error
2013年12月5日 admin 发表评论 阅读评论 以下是centos环境下,以yum安装apache及其相关软件.svn使用源码包编译,使用官网最新的1.8.5版本. 一.安装apache ope ...
- 持续集成之二:搭建SVN服务器(整合Apache+Subversion)
安装环境 Red Hat Enterprise Linux Server release 7.3 (Maipo) jdk1.7.0_80 rhel-server-7.3-x86_64-dvd.iso ...
- LDAP落地实战(二):SVN集成OpenLDAP认证
上一篇文章我们介绍了LDAP的部署以及管理维护,那么如何接入LDAP实现账号统一认证呢?这篇文章将带你完成svn的接入验证 subversion集成OpenLDAP认证 系统环境:debian8.4 ...
- Centos6.8/7.0搭建Git服务http访问方式
安装Git版本:git 2.10.0 Git访问方式:基于http的基本验证(非SSL) 1. 安装Apache软件: [root@localhost ~]# yum install httpd 设置 ...
- Apache用户认证、域名跳转、Apache访问日志
5月29日任务 课程内容: 11.18 Apache用户认证11.19/11.20 域名跳转11.21 Apache访问日志扩展 apache虚拟主机开启php的短标签 http://ask.apel ...
随机推荐
- 使用“DiskGenius”精确隐藏硬盘坏道
现在大家手中可能都有些有坏道的硬盘,也可能现在机器上的硬盘也出问题了.硬盘有坏道,肯定不会全部都是坏道,不能使用了.但我们因此而不能使用了,那么就太可惜了.所以,只要把有坏道的区域隐藏起来,就如同使用 ...
- vuejs怎么在服务器部署?(知乎)
作者:知乎用户链接:https://www.zhihu.com/question/46630687/answer/157166318来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请 ...
- dedecms获取顶级栏目名称、二级栏目名称实现方法 转
织梦DEDECMS文章.栏目页获取当前页面顶级栏目名称的方法 在用织梦做一些项目时,时常会碰到需要在当前页面调用顶级栏目名称的时候,织梦默认{dede:field name='typename' /} ...
- Apache Solr 初级教程(介绍、安装部署、Java接口、中文分词)
Python爬虫视频教程零基础小白到scrapy爬虫高手-轻松入门 https://item.taobao.com/item.htm?spm=a1z38n.10677092.0.0.482434a6E ...
- Css的前世今生
Css的基础知识扫盲 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. HTML的用法没有什么技巧,就是死记硬背,当然你不需要都记下来,能记住20个常用的标签基本上就OK了,其他不常用 ...
- 面向对象【day07】:多态(九)
本节内容 概述 多态 小结 一.概述 多态性(polymorphisn)是允许你将父对象设置成为和一个或更多的他的子对象相等的技术,赋值之后,父对象就可以根据当前赋值给它的子对象的特性以不同的方式运作 ...
- Python基础【day01】:初始模块(五)
本节内容 1.标准库 1.sys 2.os 2.第三方库 1.for mac 2.for linux Python的强大之处在于他有非常丰富和强大的标准库和第三方库,几乎你想实现的任何功能都有相应的P ...
- JVM总结(六):早期(编译期)优化
这节我们来总结一下JVM编译器优化问题. JVM编译器优化 Javac编译器 Javac的源码和调试 解析与填充符号表 注解处理器 语法分析与字节码生成 Java语法糖 泛型和类型擦除 自动装箱.拆箱 ...
- B树学习总结
1,B树的基本介绍 ①B树,相比于二叉树.红黑树而言,它的特点就是树的高度比其他类型的树要低很多.如何做到低呢?B树中的每个结点的分支数目非常大,即每个结点有很多很多孩子结点.这样,在相同结点数目情况 ...
- Dom4j工具类源码解析
话不多说,上源码: package com.changeyd.utils;import java.io.File;import java.io.FileNotFoundException;import ...