1. Install software (pay attention to the number of digits of the operating system)
Rpm-IVH nfs-utils-lib *. rpm
Rpm-IVH nfs-utils *. rpm
Rpm-IVH Portmap *. rpm
2. Edit the configuration file/etc/exports.
Add the following content:
/Opt/convirt/nfs * (RO)
Note:
Read-Only permission on the RO Client
The RW client has read and write permissions.
The root_sqush client maps to nobady when using root for access (default option)
The no_root_squash client maps to root access.
3. Start the NFS service
Service NFS start
Service Portmap start
Add boot start:
Chkconfig NFS on
Chkconfig Portmap on
Chkconfig save
4. mount NFS on the client
Mkdir/nfs/
Mount-t nfs server IP:/opt/convirt/nfs // nfs/
5. Write Permission issues
After the preceding operations, the directory is accessible but cannot be written. If you want to set it, you can write it. The following configurations are required:
/Opt/convirt/nfs * (RW, no_root_squash)
Note: The no_root_squash parameter is used by users who log on to the NFS host to use the shared directory. If it is root, the shared directory has the root permission. By default, the opposite parameter root_squash is used. When the user logging on to the NFS host and using the shared directory is root, the user's permissions will be compressed into anonymous users, generally, his UID and GID will become the nobody identity.
6. Configure to allow the specified client to connect to the NFS server
# Vi/etc/hosts. Deny
Portmap: All
# Vi/etc/hosts. Allow
Portmap: 192.168.1.
Note: NFS uses Portmap, and the new version of Portmap uses the hosts. Deny and hosts. allow files to control the access source. modify these two configuration files so that the NFS client can connect to the server normally.