#!/bin/bash

#create key pair
\rm -f /root/.ssh/id_dsa
ssh-keygen -t dsa -f /root/.ssh/id_dsa -P "" -q

#fenfa_key file
for ip in 7 41 31
do
echo "====== fanfa key to host 172.16.1.$ip==================="
sshpass -p123456 ssh-copy-id -i /root/.ssh/id_dsa.pub "-o StrictHostKeyChecking=no root@172.16.1.$ip"
echo "====== fenfa END==================="
echo ""
done