ssh批量操作
1. ssh免密登录
将终端机的id_rsa.pub内容拷贝到目标机器的 ~/.ssh/authorized_keys
2. 批量操作脚本
#!/bin/bash for host in `cat hosts.txt` do echo $host
scp <something> admin@$host:<target-directory>
ssh admin@$host << EOF <commands-here> EOF done wait echo "Job's done!"