Use this to non-interactively enter passwords for SSH hosts.
Using SSH_ASKPASS to enter passwords
snippetFor program
Use this to non-interactively enter passwords for SSH hosts.
ssh_tunnel_askpass.sh
#!/bin/sh
# Remember to chmod +x
echo "password"
Run
export SSH_ASKPASS=/usr/bin/ssh_tunnel_askpass.sh
export DISPLAY=:-
# `setsid` and `autossh` are not required, but if you're going to do this non-interactively, let's to it right
setsid autossh -M 0 -N -R 9999:127.0.0.1:22 -o StrictHostKeyChecking=false tunnel@codigoparallevar.com