10.客户机root登录上测试并挂载
[root@client2 ~]# showmount -e 192.168.10.100
Export list for 192.168.10.100:
/home *
[root@client2 ~]# mount 192.168.10.100:/home /home
[root@client2 ~]# mount
192.168.10.100:/home on /home type nfs (rw,addr=192.168.10.100)
11.下面 在客户端配置autofs自动挂载
[root@localhost ~]# umount /home #先卸掉挂载
[root@localhost ~]# service portmap start #开启portmap 服务
[root@localhost ~]# vim /etc/auto.master
/home /etc/auto.dd --timeout=30 #当NIS上的用户退出登录30秒后,自动卸载
[root@localhost ~]# cp /etc/auto.misc /etc/auto.dd
[root@localhost ~]# vim /etc/auto.dd
/* -rw,soft,intr 192.168.10.100:/home/&
12.重启autofs服务
[root@localhost ~]# service autofs restart
使用test1 登录正常
[root@localhost ~]# su - test1
[test2@localhost ~]$ ll
总计 4
drwxrwxr-x 2 test1 test1 4096 12-26 04:25 aa
[test2@localhost ~]$ pwd
/home/test1
[test1@localhost ~]$ mount
nfsd on /proc/fs/nfsd type nfsd (rw)
192.168.10.100:/home/test1 on /home/test1 type nfs (rw,soft,intr,addr=192.168.10.100)
在客户机上创建一个目录,在服务器上就可发现了。其实测试的用户所有的操作都只会保留NIS在服务器上。
13.在服务器上查看如下:
[root@localhost ~]# cd /home/test1
[root@localhost test2]# ll
总计 4
drwxrwxr-x 2 test1 test14096 12-26 09:25 aa
