LDAP Authentication client, auto-mount user home directory shell script configuration

Source: Internet
Author: User
Tags ldap openldap

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.