showmount: Querying NFS Server Exports

showmount is a command-line utility used to query the mount daemon on an NFS (Network File System) server for information about its exported file systems. It allows clients to discover which directories are made available for sharing by an NFS server, and potentially which clients have mounted them. This is useful for reconnaissance or verifying NFS server configuration.

1. Listing All Exported File Systems

To see all directories that an NFS server is exporting and making available to clients, use the -e (exports) option.

showmount -e <NFS_SERVER_IP_OR_HOSTNAME>
# Example:
showmount -e 192.168.1.10
showmount -e nfs-server.example.com

Command Breakdown:

  • showmount: Invokes the utility.
  • -e: This option tells showmount to show the NFS server’s export list.
  • <NFS_SERVER_IP_OR_HOSTNAME>: The IP address or hostname of the NFS server you want to query.

Example Output:

Export list for 192.168.1.10:
/mnt/data *
/home/users 192.168.1.0/24

This output indicates that /mnt/data is exported to everyone (*), and /home/users is exported only to clients within the 192.168.1.0/24 subnet.

2. Listing All Mounted Clients

To list all clients that have currently mounted a file system from the NFS server, use the -a (all) option.

showmount -a <NFS_SERVER_IP_OR_HOSTNAME>

This can show you active connections and help verify if your NFS clients are mounting correctly.

3. Listing Exported Directories per Client

To show all mount points for a specific client, use the -d (directories) option.

showmount -d <NFS_SERVER_IP_OR_HOSTNAME>

Prerequisites: For showmount to work, the NFS server must be running and accessible over the network. Specifically, the rpcbind service (or portmap on older systems) and the NFS daemon should be active.