290
When specifying hosts to be allowed to use a particular exported filesystem, a variety of methods can
be used, including:
•
single host — Where one particular host is specified with a fully qualified domain name, host-
name, or IP address.
•
wildcards — Where a * or ? character is used to take into account a grouping of fully qualified
domain names or IP addresses or those that match a particular string of letters.
However, be careful when using wildcards with fully qualified domain names, as they tend to be
more exact than you would expect. For example, the use of *.domain.com as wildcard will al-
low sales.domain.com to access the exported filesystem, but not bob.sales.domain.com. To match
both possibilities, as well as sam.corp.domain.com, you would have to provide *.domain.com
*.*.domain.com.
•
IP networks — Allows the matching of hosts based on their IP addresses within a larger net-
work. For example, 192.168.0.0/28 will allow the first 16 IP addresses, from 192.168.0.0 to
192.168.0.15, to access the exported filesystem but not 192.168.0.16 and higher.
•
netgroups — Permits an NIS netgroup name, written as @ <group-name> , to be used. This
effectively puts the NIS server in charge of access control for this exported filesystem, where users
can be added and removed from an NIS group without affecting /etc/exports.
The way in which the /etc/exports file is formatted is very important,
particularly concerning the use of space characters. Remember to always
separate exported filesystems from hosts and hosts from one another with a
space character. However, there should be no other space characters in the
file unless they are used in comment lines.
For example, the following two lines do not mean the same thing:
The first line allows only users from bob.domain.com read-write ac-
cess to the /home directory. The second line allows users from bob.do-
main.com to mount the directory read-only (the default), but the rest of the
world can mount it read-write. Be careful where space characters are used in
/etc/exports.
/home bob.domain.com(rw)
/home bob.domain.com (rw)
Chapter 17:Network File System (NFS)
CAUTION
Need help?
Do you have a question about the LINUX 7.2 and is the answer not in the manual?