LDAP目录服务

LDAP目录服务

使用LDAP认证

LDAP目录服务
LDAP是轻量目录访问协议,英文全称是Lightweight Directory Access Protocol,一般都简称为LDAP
LDAP服务器:
网络用户   
由服务器来集中存储并向客户端提供的信息,存储方式类似于DNS分层结构
提供的信息包括:用户名,密码,通讯录,主机映射记录

本地用户   用户信息存储在/etc/passwd

LDAP目录服务

客户端:
配置:
1.安装客户端软件sssd,与LDAP网络用户服务器沟通   yum  -y  install sssd
2.安装图形工具authconfig-gtk  配置sssd
3.打开authconfig-gtk软件   
1.LDAP2.搜索dc=example,dc=com 3.服务器classroom.example.com4.勾选TLS加密(http://classroom.example.com/pub/)5.选择LDAP密码
4.重启sssd服务
[[email protected] ~]# systemctl restart sssd  #重启
[[email protected] ~]# grep 'ldapuser0' /etc/passwd  #搜索本地用户
[[email protected] ~]# id ldapuser0     #验证网络用户id

家目录漫游

访问NFS共享
由NFS服务器将指定的文件共享给客户机
客户机将此共享目录  mount 到本地目录。访问此共享资源就像访问本地目录一样方便
类似与EXT4,XFS等类型,只不过资源在网上
如何访问NFS共享目录
查看NFS资源
格式:showmount -e 服务器地址
挂载NFS共享目录
格式:mount 服务器地址:目录路径   /本地挂载点(本地绝对路径)
[[email protected] ~]# mkdir  /mnt/test
[[email protected] ~]# mount  classroom:/home/guests  /mnt/test   //(classroom.example.com)
[[email protected] ~]# ls /mnt/test
[[email protected] ~]# su ldapuser16       //失败    系统默认目录错误
[[email protected] ~]# umount /mnt/test //卸载挂载点
[[email protected] ~]# ls /mnt/test
[[email protected] ~]# mkdir /home/guests  
[[email protected] ~]# mount classroom:/home/guests  /home/guests
[[email protected] ~]# su ldapuser16
[[email protected] root]$ id