I want to pass a password to ssh
using a bash script (Yes, I know that there are ssh keys that I could use, but this is not what I intend).
I found some solutions that were using expect
but since it is not a standard bash tool I am wondering if I can do this using pipes.
Can someone explain to me, why exactly something like this:
echo "password
" | ssh somehost.com
or
ssh somehost.com <(echo "password
")
doesn't work? Is there any possibility to make it work? Maybe executing ssh
as a different process, obtaining its PID and then sending a string directly to it?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…