標籤: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認證配置