Using nfs to share files between linux systems

Source: Internet
Author: User
Simply use nfs to share files between linux systems-Linux Enterprise applications-Linux server applications. For more information, see the following. 1. the nfs-common, nfs-kernel-server software packages to be installed on the server, and the portmap client does not need nfs-kernel-server. (In debian, you can directly use this command aptitude-r nfs-common nfs-kernel-server portmap)
2. modify the configuration file/etc/exports
/Home/sunwill 192.168.16.0/24 (rw, async)
/Nfs/nfsdir 192.168.16.5/24 (rw, sync)
The meanings of related attributes are as follows:
Ro read-only access
Rw read/write access
Sync all data written for sharing upon request
Async NFS can request data before writing data
Secure NFS is sent through the secure TCP/IP ports below 1024
Insecure NFS is sent over port 1024
Wdelay if multiple users want to write data to the NFS Directory, group write (default)
No_wdelay if multiple users want to write data to the NFS Directory, write the data immediately. This setting is not required when async is used.
Hide does not share its subdirectories in the NFS shared directory.
No_hide shares the subdirectory of the NFS Directory
Subtree_check if sub-directories such as/usr/bin are shared, force NFS to check the permissions of the parent directory (default)
No_subtree_check is opposite to the above. The parent directory permission is not checked.
All_squash: The UID and GID of the shared file are mapped to the anonymous user anonymous, which is suitable for public directories.
No_all_squash retains the UID and GID of the shared file (default)
Root_squash all requests of the root user are mapped to the same permissions as those of the anonymous user (default)
The no_root_squas root user has full management access permissions to the root directory.
Anonuid = xxx specifies the UID of an anonymous user in the NFS server/etc/passwd file
Anongid = xxx specifies the GID of anonymous users in the NFS server/etc/passwd file

3. restart the nfs-kernel-server Service after configuration, such as/etc/init. d/nfs-kernel-server restart.
Or directly use the command exportfs to make the configuration file take effect.
4. Run the showmount-e command on the client to view the shared directory of the server.
5. mount the shared directory # mount-t nfs 192.168.16.5:/home/sunwill/mnt/nfs
(/Mnt/nfs is the mounted local directory, which must be created first)
Related Article

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.