Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tunnel () {
- machine="$1"
- port_local="$2"
- port_remote="$2"
- if [ ! -z "$3" ]
- then
- port_remote="$3"
- fi
- echo "ssh $machine -N -L \"${port_local}:localhost:${port_remote}\""
- ssh $machine -N -L "${port_local}:localhost:${port_remote}"
- }
- # Now you may:
- # tunnel MyServer 8001 4001
- # tunnel MyServer 27017
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement