How do I ssh into multiple hosts (e.g host1, host2, host3, etc) and cat
/etc/fstab to generate
Yes, you can
ssh hostname command and redirect the output to your report.txt
The following script to get this report from all of your hosts. servername.dat contains all the host names.
#!/bin/sh SERVERLIST=servername.dat ICMD='cat /etc/fstab' while read SERVERNAME do ssh -n $SERVERNAME $ICMD > $SERVERNAME_report.txt done < "$SERVERLIST"