Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

showmount

Show the exports of an NFS server (and which clients mounted them).

Niveau
RHCSA-examen
Groep
Schijven en bestandssystemen
Root nodig
Nee
Pakket
nfs-utils

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

Wat het doet

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.

Zo schrijf je het

showmount [OPTION]... [HOST]

Opties 6

Meest gebruikt

-e, --exports
Show the export list.
-a, --all
Show client host and mounted folder pairs.
-d, --directories
Show only the folders mounted by clients.
--no-headers
No header line.
-h, --help
Show help.
-v, --version
Show the version.

Voorbeelden 10

$ als gewone gebruiker# als root (of met sudo)

  1. 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/24

    Folder and allowed clients.

  2. 2Local server

    showmount -e localhost

    Check your own exports.

  3. 3Firewall blocks it

    showmount -e server2
    clnt_create: RPC: Unable to receive

    Open mountd and rpc-bind on the server: firewall-cmd --add-service={mountd,rpc-bind} --permanent.

  4. 4Without showmount (NFSv4)

    mount server2:/ /mnt; ls /mnt

    The pseudo root shows the exports.

  5. 5Clients that mounted shares

    showmount -a

    On the server (NFSv3 information only).

  6. 6Only folders

    showmount -d

    Folders in use.

  7. 7For a script

    showmount -e --no-headers server2 | awk '{print $1}'

    Only the paths.

  8. 8Check before an fstab entry

    showmount -e server2 | grep -w /exports/data

    The path must match exactly.

  9. 9Find open NFS exports in your network (security)

    for h in server1 server2; do showmount -e $h 2>/dev/null; done

    Exports to * (everyone) are a data leak risk.

  10. 10Check allowed client networks

    showmount -e server2 | grep '\*'

    Exports for any host.

Exitcodes

0Done.
1Error.