• centos下svn的ldap认证配置


    前提:完成svn的基本安装

    一、安装sasl相关组件

    #yum install -y cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain

    二、查看SASL版本和提供的验证模块

    #saslauthd -v

    三、修改sasl的用户验证方式为ldap

    #cp /etc/sysconfig/saslauthd /etc/sysconfig/saslauthd.save
    #sed -i 's/MECH=pam/MECH=ldap/' /etc/sysconfig/saslauthd

    四、修改sasl配置文件(不存在则新建)

    #vi /etc/saslauthd.conf (以下信息根据ldap服务来配置)
    ldap_servers: ldap://192.168.1.2
    ldap_bind_dn: cn=chengdu,dc=sichuan,dc=com
    ldap_bind_pw: xxxxxx
    ldap_search_base: dc=sichuan,dc=com
    ldap_filter: uid=%U
    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_password_attr: userPassword
    ldap_timeout: 10
    ldap_cache_ttl: 30
    ldap_cache_mem: 32786

    五、重启sasl服务,测试是否通过

    # systemctl restart saslauthd
    # testsaslauthd -u 用户 -p 密码

    六、修改配置文件svn.conf,不存在则新建,目前不知此文件的作用

    #vi /etc/sasl2/svn.conf
    pwcheck_method:saslauthd
    mech_list:plain login

    七、重启sasl服务,并做好svn的相关配置

    #cat svnserve.conf
    [general]
    anon-access = none
    auth-access = write
    #password-db = passwd
    authz-db = authz
    realm = /opt/svn/migu/SPMS
    [sasl]
    use-sasl = true

    八、测试

    当前已切换到LDAP认证,svn服务不再调用passwd文件,也不再使用authz里的用户,但是对LDAP用户的权限控制需要在authz里设置。

    a)      以LDAP的一个用户为例(chenhongyuwx),authz不做权限的修改,使用此用户进行访问

    使用登录SPMS的密码进行登录

     

    登录失败,没有访问权限

    b)      authz对chenhongyuwx做只读的权限,使用此用户进行访问

    使用登录SPMS的密码进行登录,登录成功,说明chenhongyuwx具有读的权限,符合配置要求

    上传文件,使用chenhongyuwx用户commit失败,因为chenhongyuwx只有读权限,没有写权限,符合配置要求

    c)      authz对chenhongyuwx做读写的权限,使用此用户进行访问

    上传文件,使用chenhongyuwx用户commit成功,因为authz为其设置了读写权限。

  • 相关阅读:
    【js】js中的||和&&
    【jQuery】form表单元素序列化为json对象
    【jQuery】serializeArray()与serialize()的区别
    【jQuery】jquery-ui autocomplete智能提示
    【js】批量判断表单中的文本框非空
    【php】基础学习5
    【php】基础学习4
    【php】基础学习3
    SpringMVC与Struts2区别与比较总结
    iOS 改变UILabel部分颜色
  • 原文地址:https://www.cnblogs.com/chy-op/p/9733469.html
Copyright © 2020-2023  润新知