Nfs configuration in linux

Source: Internet
Author: User

Nfs configuration in linux [root @ manager1network-scripts] # vi/etc/exports directory host name/IP (permission) www.2cto.com save quit 2) start NFS service # chkconfig nfs on # service nfs start 3) test # showmount-e localhostexport list for localhost: exportfs-vexportfs-a first, you must manually edit the/etc/exports configuration file sharing directory using an absolute path. The permission part is shared to different hosts according to different permissions, the brackets are used to set the location of the permission parameter. When there are more than one permission, the host name is separated by brackets. For host name settings, you can use the CIDR Block: 192.168.1.0/24 or the complete IP Address: 192.168.1.23 or the host name. However, the host name must exist in/etc/hosts or be found using DNS, find the IP address. The host name supports wildcards, such *? /Mnt/sda4/share/a 192.168.23.129 (rw) www.2cto.com set the shared directory/mnt/sda4/share/a. Only the host 192.168.23.129 allows access to this shared directory, with read and write permissions/mnt/sda4/share/B 192.168.23.129 (rw) * (ro) set the shared directory/mnt/sda4/share/B, 192.168.23.129 can read and write the shared directory, other hosts can only read the shared directory/mnt/sda4/share/c 192.168.23.129 (no_root_squash) and set the shared directory/mnt/sda4/share/c. Only 192.168.23.129 can be accessed and read/write, root logon has the root permission/mnt/sda4/share/d 192.168.23.0/24 (rw) to set the shared directory/mnt/sda4/share/d, with only the network segment 192.168.23.0/24 To access and read/write this directory file/mnt/sda4/share/e * (rw, all_squash, anonuid = 500, anongid = 500) set the shared directory/mnt/sda4/share/e. All Hosts are allowed to access this shared directory and have read and write permissions. However, when they access this shared directory, the UID and GID have been set to 500. In the NFSserver host, the UID and GID = 500 permissions have been set with the following permission parameters: Rw: read-write permission Ro: read-only permission no_root_squash: users who log on to the NFS host and use the shared directory. If the user is root, they have root permissions for the shared directory, which is not recommended. Root_squash: the user logging on to the NFS host to use the shared directory. If the user is root, the user permission will be compressed to anonymous users, and the UID and GID will be compressed to nobody (nfsnobody) the identity of the system account. All_squash: no matter what the NFS user identity is, its identity is converted to an anonymous user, that is, nobody. Anonuid: anonymous; that is, nobody. You can set this UID value, but this UID must exist in/etc/passwd. Anongid: The same as the anonuid, which can be changed to the group ID. Sync: synchronize data to memory and hard disk Async: data is saved in memory first, rather than directly written to the hard disk. Permission description: 1.NFS server and NFS client have the same UID and account. If NFSserver and NFSclient have the same shared file account and UID, when the client logs on to NFSserver, the/etc/exports permission is granted. 2.NFS server and NFS client have different accounts. If NFSclient does not have an NFSserver shared file account, or the NFSclient account does not exist on NFSserver, whether the shared directory can be read and written depends on the permissions of the NFSserver. The identity of the anonymous user nobody3.NFS client is root www.2cto.com by default, the root identity of the client will be compressed into the operation of the nobody client segment of the anonymous user: The showmout command is very helpful for NFS operations and troubleshooting, so let's take a look at s Howmount usage showmout-a: this parameter is generally used on the nfs server and is used to display the cline machine that has mounted the local nfs directory. -E: displays the export directory on the specified nfs server. Showmount-e ipmount nfs directory method: mount-t nfs hostname (orIP):/directory/mount/point author yujin2010good

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.