Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jfilter/8f64f52736237b8693b075016c538897 to your computer and use it in GitHub Desktop.
Save jfilter/8f64f52736237b8693b075016c538897 to your computer and use it in GitHub Desktop.
Tunnel SSH with additional password prompt
#!/usr/bin/expect -f
set timeout -1
spawn -ignore HUP ssh -N -f -L localhost:8888:localhost:8888 <some ssh connection>
expect "<this depends on the promp> password:"
send "mypassword\r"
interact
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment