NFS service configuration and application 2-Linux Enterprise Application-Linux server application information. See the following for details. The nfs service configuration is relatively simple. You only need to modify the/etc/exports file and start it. In the exports file, you can define parameters such as the output directory of the nfs system, that is, the shared directory, access permission, and the home directory that can be accessed. By default, the file is empty and no shared directory is set. This is based on security considerations.
Each row in the exports file provides a shared directory setting. The format is as follows: output directory [client 1 (option 1 ,...) (Option 2 ,...)] [client 2 (option 1 ,...) (Option 2 ,...)] except the output directory, it is mandatory and optional.
The client refers to who can access the nfs shared directory in the network. For example: host with the IP address specified by 192.168.1.8. 192.168.1.0/24 or 192.168.1. * specifies all hosts in the subnet. The host of the domain name specified by www.jackiesr.com. * .Jackiesr.com specifies all hosts in the domain. * All hosts.
Options are used to set the access permission and user ing for the output directory. There are many configuration options for the exports file. The configuration options can be divided into three categories.
1. access permission option ro read-only rw readable and writable.
2. user ing option when the client accesses the nfs server by default, if the remote user accesses the root user, the nfs server maps it to the anonymous user nfsnobody at the cost, the group to which it belongs is also mapped to the nfsnobody group, which improves security. All_squash maps all common users and groups remotely accessed to anonymous users and groups, typically nfsnobody. No_all_squash does not map all common users and groups remotely accessed to anonymous users and groups (default setting ). Root_squash maps root users and groups to anonymous users and user groups. No_root_squash does not map root users and groups to anonymous users and user groups. Anonuid = xxx Maps Remote Access Users to anonymous users, and specifies the user account as the Local User Account UID = XXX. Anongid = xxx maps all remotely accessed user groups to anonymous user groups, and specifies the user group account as the local user group account GID = XXX.
3. Other options
Other options can be used to control output directories more securely. Secure limits the client to connect to the nfs server only from a tcp/ip port less than 1024 (default ). Insecure allows the client to connect to the nfs server from a TCP/IP Port greater than 1024. Sync writes data to the memory buffer and disk synchronously. Although this is very inefficient, it can ensure data consistency. Async saves the data to the memory buffer first, and writes the data to the disk wdelay to check whether there are related write operations. If yes, these write operations are executed together, which improves the efficiency, default settings. No_wdelay should be used with sync if any write operation is executed immediately. Subtree_check if the output directory is a sub-directory, the nfs server checks the permissions of its parent directory (default setting ). No_subtree_check even if the output directory is a subdirectory, the nfs server does not check the permissions of its parent directory, which improves efficiency.
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