LDAP轻量化目录访问协议
完成后我们需要做到autofs挂载,来实现切换用户的目的;
我们要准备两台虚拟机,server;client;分别来进行配置;
实验环境:
[root@sxb-1 home]# id ldapuser1 uid=1000(ldapuser1) gid=1000(ldapuser1) groups=1000(ldapuser1) [root@sxb-1 home]# su - ldapuser1 Last login: Mon Jul 29 06:04:01 EDT 2019 on pts/3 su: warning: cannot change directory to /home/ldapuser1: No such file or directory -bash-4.2$
server:
安装的软件:rpcbind、nfs-utils;
[root@sxb-1 migrationtools]# vim /etc/exports
/home *(rw,sync)
重启服务
[root@sxb-1 migrationtools]# systemctl restart nfs
client:
安装软件:showmount、autofs
编辑etc/auto.master
[root@sxb-1 home]# vim /etc/auto.master
/home /etc/auto.home
[root@sxb-1 home]# vim /etc/auto.home
* -filetype=nfs4,rw 192.168.88.104:/home/&
重启服务
[root@sxb-1 home]# systemctl restart autofs
测试:
[root@sxb-1 home]# ls [root@sxb-1 home]#
[root@sxb-1 home]# su - ldapuser1 Last login: Mon Jul 29 07:00:34 EDT 2019 on pts/3 [ldapuser1@sxb-1 ~]$