您正在尋找DSSH。這是一個分佈式終端。執行一次命令,它將在所有主機上執行。
甲主機文件用於
$ cat hosts
mojito
-l noland kodiak
mojito
kodiak
-C mojito
-i /home/noland/.ssh/id_rsa kodiak
運行命令
$ ./dssh.sh "uptime" < hosts
mojito:O:0:19:16:45 up 3 days, 14 min, 5 users, load average: 0.22, 0.22, 0.20
kodiak:O:0:13:24:00 up 20:00, 1 user, load average: 0.42, 0.16, 0.05
mojito:O:0:19:16:45 up 3 days, 14 min, 5 users, load average: 0.22, 0.22, 0.20
kodiak:O:0:13:24:00 up 20:00, 1 user, load average: 0.42, 0.16, 0.05
mojito:O:0:19:16:45 up 3 days, 14 min, 5 users, load average: 0.22, 0.22, 0.20
kodiak:O:0:13:24:00 up 20:00, 1 user, load average: 0.42, 0.16, 0.0