我想使用bash脚本将密码传递给ssh
(是的,我知道我可以使用ssh密钥,但这不是我想要的).
我找到了一些使用expect
的解决方案,但由于它不是标准的bash工具,我想知道是否可以使用管道来实现这一点.
有人能给我解释一下为什么会这样:
echo "passw或d\n" | ssh somehost.com
或
ssh somehost.com <(echo "passw或d\n")
doesn't w或k? Is there any possibility to make it w或k? Maybe executing ssh
as a different process, obtaining its PID and then sending a string directly to it?