How to find out how many clients are connected to my nfs server and their IP or hostname?
A quick method, which should work everywhere, is to list all connected sockets to the
nfs port via
ss on the server:
ss -a | grep nfs
There is also the showmount command:
showmount -a localhost
showmount queries the mount daemon on a remote host for information about the state of the NFS server on that machine. With no options showmount lists the set of clients who are mounting from that host. The output from showmount is designed to appear as though it were processed through ``sort -u''.
Note that there are some caveats to it:
The completeness and accuracy of the information that showmount displays varies according to the NFS server's implementation.
Because showmount sorts and uniqs the output, it is impossible to determine from the output whether a client is mounting the same directory more than once.
So for example, if a client connects multiple times to the same mount, it will appear just once in the
In this case with
ss -a you should catch them.