File Sharing in NFS mode between Linux systems

Source: Internet
Author: User


There are many file sharing methods (ftp, smba, and NFS) between Linux servers. Here we will introduce the nfs file sharing methods and implementation methods in Linux. Www.2cto.com 1. You must first enable the portmap and nfs services. Service portmap start service nfs start 2. Check whether the service is enabled. 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)
Below are some common NFS sharing parameters: www.2cto.com rw: read/write permission; ro: Read-Only permission; no_root_squash: the user logging on to the NFS host is a ROOT user, he has the ROOT permission root_squash: when the user who logs on to the NFS host using the directory is root, the user's permissions will be compressed into anonymous users, generally, his UID and GID will become the nobody identity;
All_squash: No matter what users log on to the NFS host, they will be reset to nobody. Anonuid: sets all users logging on to the NFS host to the specified user id, which must exist in/etc/passwd. Anongid: Same as anonuid, but changed to group ID! Sync: data is synchronized to the storage. Async: The data is temporarily stored in the memory and not directly written to the hard disk. Insecure allows unauthorized access from this machine. Www.2cto.com 4. exportfs-a (the shared directory everywhere) 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 shared file on the client. Mount-t nfs 192.168.111.1:/mnt/inst/mnt (shared directory on the mount server) 7. Run the mount command on the client to view the file that was just mounted. In this way, file sharing is implemented.
 

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.