CPSA ยท Unix network file, trust and remote access services
NFS exports and host-level security
The exports file, restricting by host, showmount enumeration.
Key points
- An NFS server publishes directories listed in /etc/exports.
- Each entry names the clients allowed to mount it (single host, address/netmask network, wildcard, netgroup, or * for anyone) plus options such as ro or rw.
- An entry open to * or a wide network exposes the share to anyone who can reach the server.
- Testers enumerate shares with showmount -e <host>, which prints the export list.
Source: https://man7.org/linux/man-pages/man5/exports.5.html
Practice questions
Which command asks an NFS server for its list of exported directories?
- showmount -e <host>
- showmount -d <host>
- exportfs -e <host>
- mount -l <host>
Show answer
Answer: A. showmount -e <host>
showmount -e shows the export list. -a lists client:directory pairs and -d lists only mounted directories, so they answer different questions.
Which client specifications can an /etc/exports entry use to limit who may mount a share?
- A single hostname or IP address
- A network in address/netmask form
- A MAC address of the client NIC
- A netgroup written as @name
- A local Unix username
Show answer
Answer: A. A single hostname or IP address, B. A network in address/netmask form, D. A netgroup written as @name
Single hosts, address/netmask networks and netgroups are valid client specifications. A MAC address is not used (NFS works at IP level), and a username is not a host specification.
True or false: the output of showmount -a is a reliable record of which clients are currently mounting a share.
Show answer
Answer: False
False. The showmount man page itself warns the information should not be considered reliable, since clients can mount without registering or vanish without unmounting.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
