My example is that I'm tunneling through a server and want to create a command to type in a password but leave stdin open once that's done. For example I need to sudo to a different user everytime I login to this remote host. So I do something like:
ssh -p $tunnel_port $me@localhost -t "sudo -S -u $_remoteUser -i" <<< "$( findPassword )"
'findPassword' is a function that gets my password out of a password manager
This closes the connection, how do I keep the connection open after the password has been written to stdin for sudo?