1) 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
cat>host.txt
host1
host2
host3
host4
No comments:
Post a Comment