What it does
showmount -e SERVER asks the server's mountd for its export list: the folders and who may mount them. It uses the NFSv3 mount protocol, so the server firewall must allow mountd and rpc-bind. With pure NFSv4 you can instead mount the server root (mount server:/ /mnt) and look.
How to write it
showmount [OPTION]... [HOST]Options 6
Most used
Nothing matches this filter.
Examples 10
$ run as a normal user# run as root (or with sudo)
1List the exports of a server
showmount -e server2 Export list for server2: /exports/home 192.168.122.0/24 /exports/data 192.168.122.0/24Folder and allowed clients.
2Local server
showmount -e localhostCheck your own exports.
3Firewall blocks it
showmount -e server2 clnt_create: RPC: Unable to receiveOpen mountd and rpc-bind on the server:
firewall-cmd --add-service={mountd,rpc-bind} --permanent.4Without showmount (NFSv4)
The pseudo root shows the exports.
5Clients that mounted shares
showmount -aOn the server (NFSv3 information only).
6Only folders
showmount -dFolders in use.
7For a script
showmount -e --no-headers server2 | awk '{print $1}'Only the paths.
8Check before an fstab entry
showmount -e server2 | grep -w /exports/dataThe path must match exactly.
9Find open NFS exports in your network (security)
for h in server1 server2; do showmount -e $h 2>/dev/null; doneExports to
*(everyone) are a data leak risk.10Check allowed client networks
showmount -e server2 | grep '\*'Exports for any host.
Nothing matches this filter.
Exit codes
0 :: Done. 1 :: Error.