我正在尝试编写一个脚本,它将在多台机器上运行命令pssh
。有什么方法可以在同一命令行中传递密码,如下所示:
$ pssh -h pssh-host.txt -l root -A "pswd" echo "hi"
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
Password:
尝试了以下解决方案:
sshpass -pabc pssh -h pssh-host.txt -l root -A echo "hi"
Warning: do not enter your password if anyone else has superuser
privileges or access to your account.
[1] 13:55:56 [SUCCESS] x
[2] 13:55:56 [SUCCESS] y
我不想要这个Password:
提示。有人可以为此建议一种方法吗?