centos下svn的ldap認證配置

來源:互聯網
上載者:User

標籤:start   sas   登入失敗   lis   dig   訪問   相關   sed   通過   

前提:完成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.2ldap_bind_dn: cn=chengdu,dc=sichuan,dc=comldap_bind_pw: xxxxxxldap_search_base: dc=sichuan,dc=comldap_filter: uid=%Uldap_deref: neverldap_restart: yesldap_scope: subldap_use_sasl: noldap_start_tls: noldap_version: 3ldap_auth_method: bindldap_mech: DIGEST-MD5ldap_password_attr: userPasswordldap_timeout: 10ldap_cache_ttl: 30ldap_cache_mem: 32786

 

五、重啟sasl服務,測試是否通過
# systemctl restart saslauthd# testsaslauthd -u 使用者 -p 密碼

 

六、修改設定檔svn.conf,不存在則建立,目前不知此檔案的作用
#vi /etc/sasl2/svn.confpwcheck_method:saslauthdmech_list:plain login

 

七、重啟sasl服務,並做好svn的相關配置
#cat svnserve.conf[general]anon-access = noneauth-access = write#password-db = passwdauthz-db = authzrealm = /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為其設定了讀寫權限。

 

centos下svn的ldap認證配置

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.