Search This Blog

Tuesday, 25 September 2018

Shell Script to copy ssh keys to remote Servers

#!/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=""


List the hostnames in host.txt file


No comments: