LDAP认证SVN
来源:互联网 发布:ssm网上商城源码下载 编辑:程序博客网 时间:2024/06/08 09:05
将ldap接入svn做认证
首先需要准备,ldap服务器,这里我已经准备好
域名:openldap.ww-it.cn 网址:10.9.5.17域名:vcs.ww-it.cn 网址:10.9.5.7
首先修改hosts文件
sudo vi /etc/hosts
添加一行
10.9.5.17 openldap.ww-it.cn
看看是否写正确
ping openldap.ww-it.cn
如果正确,则有
否则,请细心修改。
安装svn
Ubuntu下安装svn比较简单,输入一条命令即可解决
sudo apt-get install subversion
很容易的,中间输入一次y就好,自动安装依赖库,没有比这个更容易的了。
准备库文件
在创建版本库之前我们先准备库,方便一会儿导入进真正的版本库
cd ~sudo mkdir -p rep/codes rep/docs rep/testcd rep/codes
然后,我先捣腾点东西进去,把我原来的一个库全部给搞进来
svn co --username gavin svn://10.9.5.23/
创建svn用户
我把svn相关的文件什么的都让它来做
sudo groupadd svnsudo useradd -g svn -d /home/svn/ -s /bin/bash
创建版本库
su - svnsvnadmin create repos
接下来,我要导入数据
导入数据
exitsudo svn import rep/ file:///home/svn/repos/ -m "更换svn服务器"
rep 是先前准备的库,我这里是相对路径,所以要确保当前路径下有这个文件夹。如果导入成功就会看到adding,我这儿太多了,就不截图了。最后会显示
这时候我们来查看一下,我们的库
svn list file:///home/svn/repos/
安装sasl相关组件
由于svn连接ldap是通过sasl进行的,所以如果想不通过apache就能够时候ldap服务器,呢么我们必须让svn服务器使用sasl认证
sudo apt install libsasl2-modules-ldap sasl2-bin
配置sasl
修改saslauthd文件
先备份原来的文件
sudo cp /etc/default/saslauthd /etc/default/saslauthd.bak
修改
sudo vi /etc/default/saslauthd
改动如下:
START=yesMECHANISMS="ldap"
修改saslauthd.conf文件,如果没有就创建
sudo vi /etc/saslauthd.conf
内容如下:
# /etc/saslauthd.conf## Your AD server adress# ldap_servers: ldap://192.168.123.68:10389ldap_servers: ldap://openldap.ww-it.cn## I love default domain name, I just want to put the username part for #my authentication #not the whole user@domain.localldap_default_domain: ww-it.cn## Where are the users located in the AD? If you haven’t change the default tree of your AD it should be under the Users OU.ldap_search_base: ou=People,dc=ww-it,dc=cn## You need a user account to be able to make the authentication in the Active Directory, I suggest you create a user just for that!ldap_bind_dn: cn=Manager,dc=ww-it,dc=cn## Of course there is a password associated with this user, put it here :ldap_bind_pw: chen1399## Misc options for LDAP to make it work with Microsoft AD. Nothing to change here, move along…ldap_deref: neverldap_restart: yesldap_scope: subldap_use_sasl: noldap_start_tls: noldap_version: 3ldap_auth_method: bindldap_filter: (uid=%U)# ldap_password_attr: userPasswordldap_timeout: 10# ldap_cache_ttl: 30# ldap_cache_mem: 32768# ldap_group_dn: %r# ldap_group_match_method: filter# ldap_group_filter: (uniqueMember=%D)# ldap_group_attr: uniqueMember# EOF#########################################################
重启sasl服务以应用配置文件并测试是否通过:
sudo service saslauthd restartsudo testsaslauthd -u user -p 'password' #user和password分别替换
结果如图
修改SVN的sasl配置文件/usr/lib/sasl2/svn.conf,同样,如果配置文件不存在,新建一个
sudo vi /usr/lib/sasl2/svn.conf
内容如下:
# Password method, use the sasl authentication deamon.pwcheck_method: saslauthd#log_level: 5## Auxiliary plugin, use ldapauxprop_plugin: ldap### Mechanism list, plain text onlyallow_plaintext: truemech_list: plainldapdb_mech: plainsaslauthd_path: /var/run/saslauthd/mux# EOF
svn配置
- svnserve.conf配置
sudo vi /home/svn/repos/conf/svnserve.conf添加如下
[general]
anon-access = none
auth-access = write
auth-db = authz
[sasl]
use-sasl = true
authz配置
[aliases]# joe = /C=XZ/ST=Dessert/L=Snake City/O=Snake Oil, Ltd./OU=Research Institute/CN=Joe Average[groups]# harry_and_sally = harry,sally# harry_sally_and_joe = harry,sally,&joeadmin = gavindev = gavin,duxiaohuatest = xiongcancan,fuqiang# [/foo/bar]# harry = rw# &joe = r# * =# [repository:/baz/fuz]# @harry_and_sally = rw# * = r[/]@admin = rw* =[/codes]@dev = rw@test = r* =[/test]* = rw[/docs]* = rw
启动svn
sudo mkdir /var/log/subversionsudo svnserve -d -r /home/svn/repos/ --log-file /var/log/subversion/svnserve.log
阅读全文
0 0
- LDAP认证SVN
- LDAP认证SVN
- apache svn集成ldap认证
- svn的ldap认证配置
- LDAP认证
- LDAP 认证
- LDAP认证
- 使svn+apache利用ldap进行windows ad账号认证
- SVN集成LDAP认证及自助权限申请系统搭建
- Linux搭建使用LDAP协议认证的SVN服务器
- spring security LDAP 认证
- Spring Ldap 域认证
- C# LDAP认证登录
- LDAP 用户认证!
- C# LDAP认证登录
- django添加ldap认证
- C# LDAP认证登录
- zabbix 监控LDAP认证
- Spring Cloud构建微服务架构(二)分布式配置中心
- MFC 控件的自绘一
- dp专题2--简单dp
- POJ 2718:Smallest Difference
- lua-6 协同程序(coroutine)
- LDAP认证SVN
- 数据库框架--Litepal 使用笔记
- ubuntu16.04下安装NVIDIA驱动出现循环登陆问题
- Spring Cloud构建微服务架构(三)消息总线
- 同步EventBus真的需要在每个注册监听方法中处理使用try/catch吗
- 质数——python代码赏析
- strlen的三种实现方式
- HTML入门笔记26-HTML中文本输入框和单选按钮
- 嵌入式Linux--内存管理单元MMU