i want remote log for several hosts and check some configuration. for that i wrote a small script. it have two files. one for ip address list and other for script.
cat iplist
192.168.1.10
192.168.1.11
192.168.1.12
My script:
cat script.sh
#!/bin/bash
while read ip;
do
sshpass -p 'root' ssh root@$ip "hostname"
echo "$ip"
done < iplist
above script only display one hostname and one IP only