Article Title: Introduction to NFS in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
For example, the NFS server IP address is 192.168.1.11.
Check whether the nfs-utils and portmap software packages are installed)
Rpm-qa | grep nfs-utils rpm-qa | grep portmap
Create an NFS shared directory and Set permissions
Mkdir/share
Chmod 755/share
NFS server configuration file/etc/exports
Format:
<共享目录> [Client 1 access permission] [client 2 access permission]
<共享目录2> [Client 1 access permission] [client 2 access permission]
For example:/share 192.168.1.12 (sync, rw, no_root) * (sync, ro)
Client: You can specify an IP address or ** it indicates all or 192.168.1. * similar conditions
Permission: rw read/write permission
Ro read-only
Sync data is synchronously written to memory and Hard Disk
Async data is temporarily stored in the memory instead of directly stored in the hard disk.
No_root_squash: the user who logs on to the NFS host and uses the shared directory. If the root identity is used, the user has the root permission.
Root_squash is used to log on to the NFS host. If it is a root user, the identity is compressed to an anonymous user.
All_squash will be compressed into anonymous users when any user logs on.
Start NFS service portmap restart
Service nfs restart
Client mount: mount 192.168.1.11:/share-t nfs/mnt
Unmount: umount-a or umount/mnt
If the client starts mounting, add a line in the/etc/fstab file of the client.
192.168.1.11:/share/mnt nfs ults 0 0