Un semplice comando utile durante assessment di sistemi Linux esistenti.
Estrae:
- Mount NSF configutatiĀ in /etc/fstab
- Mount NFS attivi sul sistema
- Risoluzione Host-IP dei risultati precedenti
- Export NFS configurati in /etc/exports
- Risoluzione Host-IP dei risultati precedenti
in formato leggibile.
clear; \ echo -e "\033[0;31m######## `hostname` ######## \033[0m"; echo " "; \ echo -e "\033[0;31m### NFS mounts on /etc/fstab\033[0m"; \ grep ' nfs ' /etc/fstab; echo " "; \ echo -e "\033[0;31m### Active NFS mounts\033[0m"; \ mount |grep ' nfs '; echo " "; \ echo -e "\033[0;31m### Hosts/IP used by mounts\033[0m"; \ mount |grep ' nfs ' |cut -d ':' -f 1 |xargs -n1 ping -c1 |grep PING |cut -d ' ' -f 2,3; \ echo " "; echo " "; \ echo -e "\033[0;31m### NFS exports\033[0m"; \ cat /etc/exports |grep -v '#' |grep '/'; echo " "; \ echo -e "\033[0;31m### Hosts/IP used in exports\033[0m"; \ cat /etc/exports |grep -v '#' |grep '/' |sed -e 's/([^()]*)//g' |cut -d ' ' -f2-200 |xargs -n1 ping -c1 |grep PING |cut -d ' ' -f 2,3; echo " ";