There are a number of ways to share files among Linux servers (FTP, Smba, NFS) Here are some ways to share and implement NFS files under Linux.
1, first to open Portmap and NFS services.
Service Portmap Start
Service NFS Start
2, to see if the service is open.
Netstat-ntpl
3. Modify/etc/exports
Vi/etc/exports
#/home/temp * (Rw,sync,no_root_squash,all_squash)
/home/temp * (Ro,sync,no_root_squash,all_squash) (/home/temp indicates the directory to be shared)
/mnt/inst * (Ro,sync) (* indicates any address)
Here are some common parameters for NFS sharing:
RW: Permission to read and write;
RO: read-only permission;
No_root_squash: If a user logged into an NFS host is a root user, he has root privileges Root_squash:
If the user who is logged on to the NFS host uses the directory as root, then the user's permissions
will be compressed into anonymous user, usually his UID and GID will become nobody that identity;
All_squash: Whatever user logged on to the NFS host will be reset to nobody.
Anonuid: The user who is logged on to the NFS host is set to the specified user ID, which must exist in/etc/passwd.
Anongid: With Anonuid, but become a group ID is!
Sync: Data in synchronous write memory.
Async: The data will be temporarily stored in memory and will not be written directly to the hard drive.
Insecure allows unauthorized access from this machine.
4, exportfs-a (everywhere so shared directory)
EXPORTFS-RV (equivalent to restarting NFS)
5, Showmount-e 127.0.0.1 (check the shared directory)
Export list for 127.0.0.1:
/mnt/inst *
/home/temp *
6. Enter the required shared files on the client.
Mount-t NFS 192.168.111.1:/mnt/inst/mnt (shared directory on Mount server)
7, in the client use Mount command, you can see just the file was mount.
This is simply the realization of file sharing.