我正在尝试编写一个脚本,它将使用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:提示。有人能给我个办法吗?
发布于 2017-04-24 21:03:03
将an answer by user568109 on Unix SE命名为Community:
在发布问题后不久就在网上找到了解决方案。 解决办法是:
cat local | sshpass -ppassword parallel-ssh -I -h new_hosts -l root -A 'cat >> remote'原始解决方案:SSH/
https://stackoverflow.com/questions/43597283
复制相似问题