LDAP Network account
What is 1.LDAP?
LDAP Directory service authentication, similar to Windows Active Directory, is a way to record data
Software required by 2.LDAP clients
Yum Install SSSD krb-workstation-y
3. How to turn on LDAP user authentication
Authconfig-tui
when an error occurs because the TLS certificate is missing, you need to download the required certificate to the server side/etc/openldap/cacerts
Download command:wget http://172.25.254.254/pub/example-ca.crt
< testing >
Getent passwd Ldapuser1
If the user information can be displayed properly, prove that the client authentication is successful
List all users
vim/etc/sssd/sssd.conf
Enumerate = True
Systemctl Restart SSSD
4. Auto-mount Home Directory
because the home directory is not automatically mounted when logging on to the server side
Yum Install Autofs-y
Vim/etc/autofs.master
/HOME/GUESTS/ETC/AUTO.LDAP (boot service read AUTO.LDAP)
Vim/etc/auto.ldap
Ldapuser1 172.25.254.254:/home/guests/ldapuser1 (Automatic mount Ldapuser1)
* 172.25.254.254:/home/guests/& (Auto-mount all users)
Systemctl Restart AutoFS Restart Service
5. Non-interactive access to LDAP account completion
Script Vim set-ldap.sh
#! /bin/bash
Echo " install software ing .... "
Yum Install SSSD krb5-workstation autofs-y &>/dev/null
Echo " Config LDAP auth client ing ... "
Authconfig \
--ENABLELDAP \
--ENZBLEKRB5 \
--disableldapauth \
--ENABLELDAPTLS \
--LDAPLOADCACERT=HTTP://172.25.254.254/PUB/EXAMPLE-CA.CRT \
--ldapserver= " classroom.example.com " \
--ldapbasedn= " dc=example,dc=com " \
--krb5realm= " example.com " \
--krb5kdc= " classroom.example.com " \
--krb5adminserver= " classroom.example.com " \
--ENABLESSSD \
--enablesssdauth \
--update
Echo " Comfig LDAP User\ ' s home directory ing ... "
Echo/home/guests/etc/auto.ldap >>/etc/auto.master
Echo " * 172.25.254.254:/home/guests/& " >>/etc/auto.ladp
Systemctl Restart AutoFS
Systemctl Enable AutoFS
Sh set-ldap.sh Execution Script
This article from the "12147236" blog, reproduced please contact the author!
"Linux Rookie 2" Ldap