代码拉取完成,页面将自动刷新
#/bin/bash
#1.创建密钥
echo "正在创建..."
if [ -f /root/.ssh/id_rsa ]
then
echo "密钥对已经存在"
else
ssh-keygen -f /root/.ssh/id_rsa -N '' > /tmp/create_ssh.log 2>&1
fi
#分发密钥
echo "正在分发..."
#for ip in $(cat ip_list.txt)
for ip in 192.168.1.179 192.168.1.4
do
sshpass -p "123456" ssh-copy-id ${ip} -o StrictHostKeyChecking=no > /tmp/create_ssh.log 2>&1
echo "验证结果: $(ssh ${ip} hostname)"
done
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。