Server for NFS
Yum Install nfs-utils* Rpcbind
Start-up first
/etc/init.d/rpcbind Start/etc/init.d/nfs Start
Start Service on Boot
Chkconfig--level 345 rpcbind onchkconfig--level 345 rpcbind on
Configuration file
Vim/etc.exports
/opt/mntdir 192.168.30.0/24 (rw)/opt/mntdir2 192.168.30.0/24 (rw)
In the case of RW, the first thing to do is to secure the Write permission for the shared directory on the NFS server.
Note:
For example,/opt/mntdir is a shared directory, regardless of its attribution, the NFS server has an Ribble account, and the client has the same ID as the Ribble account. Ribble Log on Mntdir, the created file Inherits Ribble permissions.
So the best/opt/mntdir to Ribble
If the client does not have Ribble or the server does not have Ribble. The files in the/opt/mntdir are accessed with the default nobody identity (relative to the NFS server).
Several parameters:
All_squash: Maps all normal and owning groups for remote access to anonymous users or user groups (Nfsnobody), No_all_squash: Reverse with All_squash (default); root_ Squash: The root user and the owning group are mapped to anonymous users or user groups (the default); No_root_squash: Reverse with Rootsquash; ANONUID=XXX: Maps All remote access users to anonymous users. and specify that the user is a local user (uid=xxx); ANONGID=XXX: Maps All remote Access user groups to anonymous user group accounts and specifies that the anonymous user group account is a local user group account (GID=XXX) Other options Secure: Restrict clients from connecting to Server for NFS (default setting) from TCP/IP ports less than 1024, insecure: Allow clients to connect to servers from TCP/IP ports greater than 1024; Sync: Write Data synchronously to memory buffers and disks Low efficiency, but can guarantee the consistency of data; Async: Save the data in a memory buffer, write to disk if necessary, Wdelay: Check for related writes, and if any, perform these writes together to improve efficiency (default setting); No_ Wdelay: If a write operation is performed immediately, it should be used in conjunction with sync; subtree: If the output directory is a subdirectory, the NFS server will check the permissions of its parent directory (default setting); No_subtree: Even if the output directory is a subdirectory, The NFS server also does not check the permissions of its parent directory, which can improve efficiency;
Client actions
SHOWMOUNT-E 192.168.1.75
Mount-t NFS 192.168.30.129:/opt/mntdir//opt/
This article is from the "[email protected]" blog, please be sure to keep this source http://ribble.blog.51cto.com/3863110/1657912
Linux NFS Server detailed