1.ldap客户端挂载
#System-config-authentication
输入system-config-authentication,按照如图配置:
dc=example,dc=com
ldap://172.16.140.2
#Su – ldapuser1
会提示你没有家目录
我们开始 autofs
#Vim /etc/auto.master
/misc/etc/auto.misc 《--- 把这一行复制成下一行
/home/etc/auto.misc
#vim /etc/auto.misc
黑色部分需要自己写入,保存退出
重启服务.
Su – ldapuser1
会发现有家目录了。实验完毕!
考试的脚本
[[email protected] Desktop]# cat /root/scripts
#!/bin/bash
case $1 in
a)
echo b
;;
b)
echo a
;;
*)
echo "/root/scripts a|b"
;;
Esac
保存退出
#chmod u+x /root/scripts
测试
#base /root/scripts a
他会出B
#base /root/scripts b
他会出A
#base /root/scripts 234234
他会出/root/scripts a|b