Bash script to set up a temporary SSH tunnel

前端 未结 6 1037
你的背包
你的背包 2020-12-12 08:46

On Cygwin, I want a Bash script to:

  1. Create an SSH tunnel to a remote server.
  2. Do some work locally that uses the tunnel.
  3. Then shut down the
6条回答
  •  旧时难觅i
    2020-12-12 09:26

    You could launch the ssh with a & a the end, to put it in the background and grab its id when doing. Then you just have to do a kill of that id when you're done.

提交回复
热议问题