Bitzu

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

Single choice

Which command asks an NFS server for its list of exported directories?

  1. showmount -e <host>
  2. showmount -d <host>
  3. exportfs -e <host>
  4. 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.

Select all that apply

Which client specifications can an /etc/exports entry use to limit who may mount a share?

  1. A single hostname or IP address
  2. A network in address/netmask form
  3. A MAC address of the client NIC
  4. A netgroup written as @name
  5. 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

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.

Download on the App StoreGet it on Google Play

More CPSA topics in this module