NFS Installation and Configuration

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.