I'm attempting to write a script that will login to a remote server via ssh, without popping up a password prompt to the user (the remote server is not under my control, and they won't allow me to use key authentication).
Normally I just pass the password into the command, and this works fine, but every 3 months, they want me to change the password, so it pops up a password prompt, which breaks my script. I've tried capturing the password prompt via STDOUT and STDERR, but it is not getting sent to either one. I'm not sure how to capture the prompt, or send the response back.
As a test, I've tried just doing ssh without a password, and get the same basic behavior.
ssh email@example.com 2> /dev/null
still shows the password prompt, e.g.
ssh -T and
any tips would be appreciated.