#!/bin/ksh
echo "Enter your password: "
stty -echo
read -s SSHPASS
export SSHPASS
stty echo
for host in `cat host.txt`
do
sshpass -e ssh-copy-id -f ${host} -o StrictHostKeyChecking=no
done
SSHPASS=""
echo "Enter your password: "
stty -echo
read -s SSHPASS
export SSHPASS
stty echo
for host in `cat host.txt`
do
sshpass -e ssh-copy-id -f ${host} -o StrictHostKeyChecking=no
done
SSHPASS=""
List the hostnames in host.txt file
No comments:
Post a Comment