#!/bin/bash
# 目标主机列表
IP="
192.168.10.51
192.168.10.52
192.168.10.53
192.168.10.54
192.168.10.55
192.168.10.56
192.168.10.57
192.168.10.58
192.168.10.59
192.168.10.60
192.168.10.61
"
for node in ${IP};do
sshpass -p 123456 ssh-copy-id ${node} -o StrictHostKeyChecking=no
if [ $? -eq 0 ];then
echo "${node} 密钥 copy 完成"
eles
echo "${node} 密钥 copy 失败"
fi
done