Linux 批次管理服务器小工具 - PSSH - 四种,示例(提供 man 手册)
最编程
2024-03-03 20:53:27
...
Connect to host1 and host2, and print "hello, world" from each:
pssh -i -H "host1 host2" echo "hello, world"
Print "hello, world" from each host specified in the file hosts.txt:
pssh -i -h hosts.txt echo "hello, world"
Run a command as root with a prompt for the root password:
pssh -i -h hosts.txt -A -l root echo hi
Run a long command without timing out:
pssh -i -h hosts.txt -t 0 sleep 10000