How to Configure NFS in Linux

Source: Internet
Author: User

1. Install software (pay attention to the number of digits of the operating system)

Rpm-IVH nfs-utils-lib *. rpm

Rpm-IVH nfs-utils *. rpm

Rpm-IVH Portmap *. rpm


2. Edit the configuration file/etc/exports.

Add the following content:

/Opt/convirt/nfs * (RO)

Note:

Read-Only permission on the RO Client
The RW client has read and write permissions.
The root_sqush client maps to nobady when using root for access (default option)
The no_root_squash client maps to root access.

3. Start the NFS service

Service NFS start

Service Portmap start

Add boot start:

Chkconfig NFS on

Chkconfig Portmap on

Chkconfig save

4. mount NFS on the client

Mkdir/nfs/

Mount-t nfs server IP:/opt/convirt/nfs // nfs/

5. Write Permission issues

After the preceding operations, the directory is accessible but cannot be written. If you want to set it, you can write it. The following configurations are required:

/Opt/convirt/nfs * (RW, no_root_squash)

Note: The no_root_squash parameter is used by users who log on to the NFS host to use the shared directory. If it is root, the shared directory has the root permission. By default, the opposite parameter root_squash is used. When the user logging on to the NFS host and using the shared directory is root, the user's permissions will be compressed into anonymous users, generally, his UID and GID will become the nobody identity.

6. Configure to allow the specified client to connect to the NFS server

# Vi/etc/hosts. Deny
Portmap: All

# Vi/etc/hosts. Allow
Portmap: 192.168.1.

Note: NFS uses Portmap, and the new version of Portmap uses the hosts. Deny and hosts. allow files to control the access source. modify these two configuration files so that the NFS client can connect to the server normally.

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.