This is the LDAP authentication client with the auto-mount home directory Shell script configuration, using "Authconfig-tui" graphical configuration is simple, but manual operation is required later, the automatic writing configuration file has not been researched thoroughly. Later perfect
#!/bin/bashyum install -y nss-pam-ldapd nfs-utils nfs autofs pam_ldap Openldap openldap-clients#showmount -e 172.16.16.22automaster= "/etc/auto.master" automisc= "/etc/ Auto.misc "ldaphomedir="/ldapdir/users "[ -d " $ldaphomedir " ] | | mkdir -p "$ldaphomedir" cat /etc/auto.misc | grep "172.16.16.22" & >/dev/nullif [ $? -eq 0 ]; then echo echo ' Autofs 172.16.16.22 is exist ' sleep 2elif [ -f "$automisc" -a -f "$automaster"]; then sed -i ' $a /ldapdir /etc/auto.misc ' $automaster &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBsp;sed -i ' $a * 172.16.16.22:/ldapdir/users ' $automiscelse echo "autofs is not exist " fi/etc/init.d/autofs restartchkconfig autofs onhead -n 20 <<eof ######################### ############################################# #The next step configuration LDAP authentication information # #Press the "Space" key to select "*" # #First: # # Use LDAP ----------------------"*" # # &nbSp; use md5 passwords--------------"*" # # use shadow passwords-----------"*" # # Use Ldap authentication--------"*" # #Second: # #BASE dc= zxsoft,dc=com # #URI ldap://172.16.16.22 # #you &NBSP;CAN&NBSP;REMEMBer this# # ############################################################# ######## #EOFechoread -p "continue y or n:" selectcase $select in "Y" | " Y ") authconfig-tui;; "N" | " n ") exit 2;; *) echo "Input error " && exit 3 ;; Esac
This article is from the "Potato It" blog, be sure to keep this source http://malin314.blog.51cto.com/7206614/1864966
LDAP Authentication client, auto-mount user home directory shell script configuration