Skip to main content

NFS server + client

v0.1.11

Inspect a host's NFS exports, mounted shares, RPC state, active client connections. Plus two narrow operator actions: exportfs -r (re-export) and exportfs -u (unexport one client:path — evicts that client). Read-only otherwise.

7 allowed by default 2 need approval by default
Pack ID
nfs
Vendor
emisar
OS
linux
Actions
9
Required binaries. Install these on the host before relying on the pack — an action that calls a missing one fails at run time.
exportfs nfsstat rpcinfo showmount

Install

emisar pack install fetches this pack, re-validates it, and verifies its content hash against the --hash below — the exact bytes this page was rendered against, so a tampered copy is rejected — before copying it into the runner's packs dir. The command reloads a running daemon itself; no manual restart.

on the runner host
sudo emisar pack install nfs --hash sha256:613b47ce5eaa58a7b1ef1bc0b027f170cbb66594e88f0539215ded2c4e84848b

Setup

Inspects the local runner host's NFS server/client state — no credentials needed.

Host access

Run these commands yourself on the runner host. Emisar shows and copies setup recipes; it never runs them.

Read and change the kernel NFS export table as root.

nfs.exportfs_vnfs.exportfs_rnfs.exportfs_unexport_path

Run the Emisar service as root

Grant access
sudo install -d -m 0755 /etc/systemd/system/emisar.service.d
printf '%s\n' '[Service]' 'User=root' 'Group=root' | sudo tee /etc/systemd/system/emisar.service.d/10-nfs-host-access.conf >/dev/null
sudo systemctl daemon-reload
sudo systemctl restart emisar
Verify access
test "$(systemctl show emisar --property=User --value)" = root

Impact: Every Emisar action on this runner executes as root. Export actions can expose or withdraw host filesystems from NFS clients.

Notes

  • showmount, nfsstat, rpcinfo, the kernel mount inventory, and the exported-table file read work without elevated host access.

Verify it works

Runs nfs.exportfs_v, a low-risk read that confirms the pack can reach its target. Run it on the host once the pack is installed; pack install runs it for you.

on the runner host
sudo emisar pack verify nfs

Install and configure a pack walks through the whole sequence on a host.

Actions 9 total

View on GitHub
  • nfs.cat_etab exec low Low — read-only or trivially reversible

    cat /var/lib/nfs/etab

    Show the effective export table (what kernel actually serves).

    View source on GitHub
  • nfs.exportfs_r exec high High — service-affecting

    exportfs -r

    Re-export everything in /etc/exports. New mounts work; established clients may stall briefly.

    View source on GitHub
  • nfs.exportfs_unexport_path exec high High — service-affecting

    exportfs -u <client>:<path>

    Stop exporting one path to one client. Active mounts on that client start failing operations. Use to evict a misbehaving client without restarting the NFS server.

    View source on GitHub
  • nfs.exportfs_v exec low Low — read-only or trivially reversible

    exportfs -v

    List currently-exported NFS shares + options.

    View source on GitHub
  • nfs.nfs_mounts exec low Low — read-only or trivially reversible

    NFS mounts on this host

    List all NFS-typed mounts currently visible.

    View source on GitHub
  • nfs.nfsstat_c exec low Low — read-only or trivially reversible

    nfsstat -c (client)

    Show client-side RPC + NFS op counts.

    View source on GitHub
  • nfs.nfsstat_s exec low Low — read-only or trivially reversible

    nfsstat -s (server)

    Show server-side RPC + NFS op counts.

    View source on GitHub
  • nfs.rpcinfo_p exec low Low — read-only or trivially reversible

    rpcinfo -p

    List RPC services registered with rpcbind.

    View source on GitHub
  • nfs.showmount_e exec low Low — read-only or trivially reversible

    showmount -e

    List exports as seen via rpcbind (what NFS clients discover). On NFSv4-only hosts (no mountd/rpcbind) it returns "RPC: Program not registered" — use nfs.exportfs_v for the authoritative export list there.

    View source on GitHub