Experimental environment
RHEL5.9 two units
Experiment One:
Share/root to 192.168.10.20, writable, synchronous, allowing the client to be accessed with root access
Server-side configuration:
[[email protected] ~]# Rpm-qa |grep NFS//Check if package is installed
Nfs-utils-lib-1.0.8-7.9.el5
Nfs-utils-1.0.9-66.el5
[Email protected] ~]# Rpm-qa |grep portmap
portmap-4.0-65.2.2.1
[[email protected] ~]# cat/etc/exports//Master config file
/root 192.168.1.10 (Rw,sync,no_root_squash)
shared directory [client 1 parameter 1] [client 2 parameters] ... ..
[[Email protected] ~]# service Portmap restart//Start services, first start Portmap
Stop portmap: [OK]
Start Portmap: [OK]
[[Email protected] ~]# Service NFS Restart
Client:
[[email protected] ~]# service portmap restart//client start Portmap Services
[[email protected] ~]# SHOWMOUNT-E 192.168.1.253//View the path that can be mounted
Export list for 192.168.1.253:
/root 192.168.1.10
[[email protected] ~]# mount 192.168.1.253:/root/data/root///Mount
[[email protected] root]# Touch AA
[[email protected] root]# ll AA//Test Mount permission
-rw-r--r--1 root root 0 06-12 19:31 AA
Experiment Two:
Share/USR/SRC to 192.168.10.0/24 network segments, writable, asynchronous
Service side
Cat/etc/exports
/root 192.168.1.10 (Rw,sync,no_root_squash)
/USR/SRC 192.168.1.0/24 (Rw,async)
EXPORTFS-RV//Restart read configuration file
Setfacl-m u:nfsnobody:rwx src///Set access rights
Client:
[[email protected] src]# Touch AA
[email protected] src]# LL
Total 24
-rw-r--r--1 nfsnobody nfsnobody 0 06-12 19:39 AA
Experiment Three:
On the basis of the previous experiment, all the user identities on the client are mapped into Nfsnobody
Service side:
Cat/etc/exports
/root 192.168.1.10 (Rw,sync,no_root_squash)
/USR/SRC 192.168.1.0/24 (Rw,async,all_squash)
Exportfs-rv
Post-mount Test
[[email protected] src]$ Touch BB
[email protected] src]$ LL
Total 24
-rw-rw-r--1 u1 u1 0 06-12 19:42 bb
Experiment Four:
Enable mount and Trigger mount
Boot mount
Cat/etc/fstab
192.168.1.253:/root/data/root/nfs Defaults 0 0
Umount-a
Mount-a
No error is successful
Trigger Mount
Cat/etc/auto.master
/data/etc/auto.src
Cat/etc/auto.src
Src-fstype=nfs 192.168.1.253:/USR/SRC
Service AutoFS Restart
Cd/data/src
Mount |grep SRC