I would like to use ssh key authentication. I have a file that contains:
ip location
ip location
etc
i have a bash script as follow :
If you don't want to use a password and security is not important, another solution is to use sshpass.
This is generally not a good idea, specially in secure environments, but in some situations it can help.
sshpass -p raspberry ssh pi@192.168.0.145
this can be combined with
ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no pi@192.168.0.145
to avoid confirmation questions that prevent automated scripting from happening.
Again, only use this in development systems where different machines share an IP and security is not important.
https://ownyourbits.com/2017/02/22/easy-passwordless-ssh-with-sshh/