SHARE
TWEET

Untitled

a guest Sep 18th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. tunnel () {
  2.     machine="$1"
  3.     port_local="$2"
  4.     port_remote="$2"
  5.     if [ ! -z "$3" ]
  6.     then
  7.         port_remote="$3"
  8.     fi
  9.     echo "ssh $machine -N -L \"${port_local}:localhost:${port_remote}\""
  10.     ssh $machine -N -L "${port_local}:localhost:${port_remote}"
  11. }
  12.  
  13. # Now you may:
  14. # tunnel MyServer 8001 4001
  15. # tunnel MyServer 27017
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top