利用腳本非互動式建立LDAP網絡使用者賬戶并建立家目錄
#!/bin/bash
echo "install packages..."
yum install sssd krb5-workstation autofs -y &> /dev/null
安裝所需要的sssd服務,krb5-workstation服務,autofs服務
echo "config authconfig..."
authconfig \
打開authconfig服務
--enableldap \
預設啟用LDAP用于使用者資訊
--enablekrb5 \
預設啟用kerberos認證
--disableldapauth \
預設禁用LDAP用于認證
--enableldaptls \
啟用帶TLS的LDAP
--ldapserver="classroom.example.com" \
預設LDAP伺服器的主機名或URL
--ldapbasedn="dc=example,dc=com" \
預設LDAP基礎DN
從該URL加載CA憑證
--krb5realm="EXAMPLE.COM" \
預設kerberos域
--krb5kdc="classroom.example.com" \
預設kerberos KDC
--krb5adminserver="classroom.example.com" \
--update
echo "config autofs ...." (配置網絡使用者家目錄)
echo "/home/guests /etc/auto.ldap" >>/etc/auto.master 編輯主配置檔案
echo "* 172.25.254.254:/home/guests/&" >>/etc/zuto.ldap 編輯子配置檔案
systemctl restart autofs
echo " ok !!"
<b>本文轉自 昭He淺墨 51CTO部落格,原文連結:http://blog.51cto.com/502703956/1921265,如需轉載請自行聯系原作者</b>