I have a list of IP's let's say IP.txt and I need to compose a script which tries to login to those ip's with username "fsp" and passwd let's say "abcd". if connection is succesfull , please send name of the server with some status , if not, please send me another output with let's say "failed name of server conection". Can you please help me out here ? these has to be in Linux /bin/bash...
I tried some "for loops" but it take me out only servers with succesfull state like :
for i in `cat IP.txt`; do
sshpass -p "abcd" ssh fsp@$i " cat /etc/os-release "
done >> outputIP.txt