116

批量分发密钥对-linux-51CTO博客

 7 years ago
source link: http://blog.51cto.com/13132636/2066607
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

批量分发密钥对

#!/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 [email protected].$ip"
echo "====== fenfa END==================="
echo ""
done

©著作权归作者所有:来自51CTO博客作者AlibaP5的原创作品,如需转载,请注明出处,否则将追究法律责任

Recommend

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK