ssh -c
https://www.cnblogs.com/bodhitree/p/6018369.html
pssh
这里有个疑问
[root@falcon-182-032 script]# cat test_remote_cmd.sh
#!/bin/bash
su - yarn;
whoami;
[root@falcon-182-032 script]# pssh -H 172.21.21.21 -P -I < test_remote_cmd.sh
172.21.21.21: yarn
172.21.21.21: Last login: Fri Aug 27 00:51:05 CST 2021
[1] 01:01:43 [SUCCESS] 172.21.21.21
[root@falcon-182-032 script]# vim test_remote_cmd.sh
[root@falcon-182-032 script]# pssh -H 172.21.21.21 -P -I < test_remote_cmd.sh
172.21.21.21: Last login: Fri Aug 27 01:01:43 CST 2021
172.21.21.21: root
[1] 01:01:57 [SUCCESS] 172.21.21.21
只是简单换个行, whoami 输出的结果就不一样了