标签:for end dev style a* ash === keygen info
centos6.6 批量分发脚本
#!/bin/bash #chuangjian,key pair rm -f /root/.ssh/id_dsa* ssh-keygen -t dsa -f /root/.ssh/id_dsa -P "" -q #install sshpass yum install sshpass -y &>/dev/null # fenfa key file for ip in `cat /server/scripts/game_ip.txt` do echo "===== fenfa key to host $ip =====" sshpass -proot密码 ssh-copy-id -i /root/.ssh/id_dsa.pub "-o StrictHostkeyChecking=no root@$ip" echo "============= fenfa end ==================" echo "" done
批量检查脚本
#!/bin/bash CMD="$1" if [ $# -ge 1 ];then for ip in ·cat game_ip.txt· do echo "====== host $ip info ========" ssh $ip $CMD echo "======================================" echo "" done else exit fi
标签:for end dev style a* ash === keygen info
原文地址:https://www.cnblogs.com/root0/p/9278187.html