多台机起密钥脚本

#!/bin/bash
rm -rf ~/.ssh/id_rsa*
ssh-keygen -f ~/.ssh/id_rsa -P "" > /dev/null 2>&1
SSH_Pass=1
Key_Path=~/.ssh/id_rsa.pub
for ip in 132
do
sshpass -p$SSH_Pass ssh-copy-id -i $Key_Path "-o StrictHostKeyChecking=no" 192.168.144.$ip
done

posted @ 2022-11-04 17:38  L北冥  阅读(30)  评论(0)    收藏  举报