1. 程式人生 > >Linux學習134 Unit 8

Linux學習134 Unit 8

windows linux 客戶端 記錄 認證

Unit8 ldap網絡帳號

1.ldap是什麽

ldap目錄服務認證,和windows活動目錄類似,就是記錄數據的一種方式

2.ldap客戶端所須軟件

yum sssd krb5-workstation -y

3.如何開啟ldap用戶認證

authconfig-tui

┌────────────────┤ Authentication Configuration ├─────────────────┐

│ │

│ User Information Authentication │

│ [ ] Cache Information [ ] Use MD5 Passwords │

│ [*] Use LDAP [*] Use Shadow Passwords │

│ [ ] Use NIS [ ] Use LDAP Authentication │

│ [ ] Use IPAv2 [*] Use Kerberos │

│ [ ] Use Winbind [ ] Use Fingerprint reader │

│ [ ] Use Winbind Authentication │

│ [*] Local authorization is sufficient │

│ │

│ ┌────────┐ ┌──────┐ │

│ │ Cancel │ │ Next │ │

│ └────────┘ └──────┘ │

│ │

│ │

└─────────────────────────────────────────────────────────────────┘

技術分享

┌─────────────────┤ LDAP Settings ├─────────────────┐

│ │

│ [*] Use TLS │

│ Server: ldap://classroom.example.com/___________ │

│ Base DN: dc=example,dc=com_______________________ │

│ │

│ ┌──────┐ ┌──────┐ │

│ │ Back │ │ Next │ │

│ └──────┘ └──────┘ │

│ │

│ │

└───────────────────────────────────────────────────┘

技術分享

┌─────────────────┤ Kerberos Settings ├──────────────────┐

│ │

│ Realm: EXAMPLE.COM_____________________________ │

│ KDC: classroom.example.com___________________ │

│ Admin Server: classroom.example.com___________________ │

│ [ ] Use DNS to resolve hosts to realms │

│ [ ] Use DNS to locate KDCs for realms │

│ │

│ ┌──────┐ ┌────┐ │

│ │ Back │ │ Ok │ │

│ └──────┘ └────┘ │

│ │

│ │

└────────────────────────────────────────────────────────┘

技術分享

<當出現以下報錯時>

┌────────────────┤ Warning ├─────────────────┐

│ │

│ To connect to a LDAP server with TLS │

│ protocol enabled you need a CA certificate │

│ which signed your server‘s certificate. │

│ Copy the certificate in the PEM format to │

│ the ‘/etc/openldap/cacerts‘ directory. │

│ Then press OK. │

│ │

│ ┌────┐ │

│ │ Ok │ │

│ └────┘ │

│ │

│ │

└────────────────────────────────────────────┘

時因為tls的證書缺失,需要到服務器端下載所需要的證書到/etc/openldap/cacerts,

用到的命令

wget http://172.25.254.254/pub/example-ca.crt

<測試>

getent passwd ldapuser1

如果用戶信息可以正常顯示,證明客戶端認成功。

4.自動掛載用戶家目錄

yum install autofs -y

vim /etc/autofs.master

/home/guests/etc/auto.ldap

vim /etc/auto.ldap

ldapuser1172.25.254.254:/home/guests/ldapuser1

+++++++++++++++++++++++++++++++++++++++++++++++++++++++

*172.25.254.254:/home/guests/&

systemctl restart autofs

技術分享


技術分享

技術分享

技術分享

技術分享

技術分享

技術分享

技術分享

技術分享


Linux學習134 Unit 8