Advertisement
Guest User

Untitled

a guest
Sep 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement