Você pode usar sshpass, mas é melhor usar ansible . Exemplo de uso de sshpass:
# vim server.list
192.168.0.100
192.168.0.101
# apt-get install sshpass
$ vim script.sh
#!/bin/bash
while read -r line
do
echo "running $line"
SSHPASS=PASSWORD sshpass -e ssh-copy-id USERNAME@"$line" -o "StrictHostKeyChecking no"
done < "server.list"
Executar script:
$ sh script.sh
running 192.168.0.100
...
Number of key(s) added: 1
running 192.168.0.101
...
Number of key(s) added: 1