I'm writing a script to take a password and SSH with it. NOTE: I won't go into detail, but security/encryption is not an issue here--Hardcoded password is what I want. However, I'm having trouble piping it in so that the Unix script answers the "password:" prompt with it. I tried piping it in and it still asked me for the prompt.
I've seen answers on here that use expect...I'm not a shell scripting expert, when I tried it I got the errors spawn: command not found, interact: command not found, and send: command not found. I've tried googling some kind of expect to download and found nothing...what am I missing? this script should be distributable to people who may or may not have an external script installed.
My non-working code:
#!/bin/bash"
STR="MYPASS"
echo $STR | ssh -t -t user@host