Vi/etc/exports #需要在root权限下
In the file, insert the following format:
The server IP (rw,no_root_squash,sync) that requires the absolute path of the shared file to accept the file
Save File
Restart Nfs:service NFS Restart or/etc/init.d/nfs restart
Start Protmap:service protmap Restart
Log on to the server that receives the shared directory
Vi/etc/exports
Server IP (rw,no_root_squash,sync) that receives an absolute path that requires shared files to share the file
Restart Nfs:service NFS Restart
To execute mount commands on a server that shares files
MOUNT-T NFS Server IP: Absolute path that requires shared files to receive absolute paths for shared files
The IP that is filled in the exports file can be in the format:
* All IP
Fixed IP/8 can start for 8,16,24,32 such as IP 192.168.1.1/8 on behalf of server IP 192 192.168.1.1/16 on behalf of server IP for 192.168, etc.
Fixed IP receive placed as fixed IP
The parameters after the IP parameters are as follows:
Ro This host has read-only access to the shared directory
RW This host has read and write access to the shared directory
When the Root_squash client accesses the shared folder with the root user, the root user is mapped to an anonymous user
The root user is not mapped when the No_root_squash client accesses the shared folder with root
All_squash mapped to anonymous users when any user on the client access the shared directory
Anonuid A user who maps a user on a client to a specified local user ID
Anongid maps the user on the client to the specified local user group ID
Sync data synchronously written to memory and hard disk
Async data is staged in memory, not directly to the hard disk
Insecure allows unauthorized access from this machine.
Sharing files between Linux servers