#!/bin/bash标签:node,分发,批量,168.10,IP,echo,密钥,copy From: https://blog.51cto.com/u_15222272/5983938
# 目标主机列表
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