10.配置LDAP客户端

在classroom.example.com上已经部署了一台LDAP认证服务器,按以下要求将你的系统加入到该LDAP服务中,并使用Kerberos认证用户密码:
该LDAP认证服务的Base DN为:dc=example,dc=com
该LDAP认证服务的LDAP Server为:classroom.example.com
密码认证服务的Kerberos Realm为:EXAMPLE.COM (域控的林)
密码认证服务的Kerberos KDC为:classroom.example.com
密码认证服务的Kerberos Admin Server为:classroom.example.com
认证的绘画连接需要使用TLS加密,加密所用证书请在此下载http://classroom.example.com/pub/example-ca.crt

  

另1:图形界面

tab补齐

[root@server0 ~]# yum install authconfig-gtk.x86_64 sssd krb5-workstation.x86_64 -y
[root@server0 ~]# system-config-authentication

  RHCSA-day3-LMLPHP

  RHCSA-day3-LMLPHP

tab补齐
[root@server0 ~]# systemctl restart sssd.service
[root@server0 ~]# systemctl enable sssd
[root@server0 ~]# systemctl status sssd.service

  

另2:文本界面

[root@server0 ~]# yum install authconfig-gtk.x86_64 sssd krb5-workstation.x86_64 -y
[root@server0 ~]# authconfig-tui

  

RHCSA-day3-LMLPHP

RHCSA-day3-LMLPHP

RHCSA-day3-LMLPHP

RHCSA-day3-LMLPHP

[root@server0 ~]# cd /etc/openldap/cacerts/
[root@server0 cacerts]# wget http://classroom.example.com/pub/example-ca.crt [root@server0 cacerts]# systemctl restart sssd
[root@server0 cacerts]# systemctl enable sssd
[root@server0 cacerts]# systemctl status sssd [root@server0 ~]# authconfig-tui 记得重新查看下,

  

验证:(如果没有重启再查看)  (多重启几次sssd服务)
[root@server0 ~]# su - ldapuser0
su: warning: cannot change directory to /home/guests/ldapuser0: No such file or directory
mkdir: cannot create directory '/home/guests': Permission denied
-bash-4.2$
-bash-4.2$
-bash-4.2$
说明LDAP配置成功 , ldapuser0 用户是在LDAP网络上的,不在本地

  

11.配置LDAP用户家目录自动挂载

请使用LDAP服务器上的用户ldapuser0登陆系统,并满足以下要求:

ldapuser0用户的家目录路径为/home/guests/ldapuser0

ldapuser0用户登陆后,家目录会自动挂载到classroom.example.com服务通过nfs服务到处的/home/guests/ldapuser0

[root@server0 ~]# yum install autofs.x86_64 -y
[root@server0 ~]# showmount -e classroom.example.com
Export list for classroom.example.com:
/home/guests 172.25.0.0/255.255.0.0 (LDAP网络共享的目录) [root@server0 ~]# rpm -ql autofs
/etc/auto.master
/etc/auto.misc [root@server0 ~]# vim /etc/auto.master
/misc /etc/auto.misc 这行下面添加 (存在)
/home/guests /etc/auto.guests (添加)
监控的目标(本地) 监控的条件 [root@server0 ~]# cat /etc/auto.misc
cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
文件系统类型 [root@server0 ~]# vim /etc/auto.guests (新文件)
* -fstype=nfs classroom.example.com:/home/guests/&
*会根据&变化             &:匹配所有 (网络上的目录) [root@server0 ~]# systemctl restart autofs (root下生成/home/guests/ldapuser0)
[root@server0 ~]# systemctl enable autofs
[root@server0 ~]# systemctl status autofs

  

[root@server0 ~]# su - ldapuser0       成功切换目录,证明2个题都做对了
[ldapuser0@server0 ~]$ ll /home/guests/
drwx------. 5 ldapuser0 ldapuser0 101 Sep 29 18:26 ldapuser0
[ldapuser0@server0 ~]$ df -h
   ldapuser0 用户,以及家目录不在本地,而在LDAP网络上
05-11 20:03