2. Installing and configuring NFS Services
Server: Yum install-y nfs-utils Rpcbind,rpcbind is for client and server communication. Open configuration file Vi/etc/exports
Write on the leftmost who needs to share the directory, such as:/Boot 192.168.137.5 (Rw,sync) (this is the share to which IP, which clients to share, RW indicates that the client can only read and write, RO is read-only, sync means synchronization). When you are finished configuring, start Rpcbind and Nfs,/etc/init.d/rpcbind Start,/etc/init.d/nfs start
Remote client: Yum install-y nfs-utils showmount-e 192.168.137.3 (server IP, this command will normally display export list for 192.168.137.3:/boot 192 .168.137.5. /boot represents the shared directory, 192.168.137.5 is shared with 5 of this IP client, mount-t NFS 192.168.137.3:/boot/opt. You will see the mount after df-h. This time cd/opt/into the opt directory, touch 1.txt will prompt insufficient permissions. So this time back to the server: [[email protected] mnt] #chmod 777. This hand back to the client: into the OPT directory, the second touch 1.txt will be successful, and 1.txt of both the owner and the group are nfsnobody. This nfsnobody can be customized and cat/etc/passwd on the client side, such as finding a 501 user. Back to the server: Vi/etc/exports, add all_squash,anonuid=501,anongid=501 at the back of sync, service end multiplicity Kai/etc/init.d/nfs restart. Back to client: Uninstall in opt directory, Umount-l/opt/. This time in the OPT directory: Mount-t nfs-onolock,nfsvers=3 192.168.137.3:/boot/opt. LL look under 501 genera and the owner is WANJJ successful. You can also not limit root, remove all_squash,anonuid=501,anongid=501 in/etc/exports, increase No_root_squash, This time back to the client uninstall mount after re-mount the file created in the OPT directory is the owner and the group is root.
NFS Installation and Configuration