Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- # [ssh_port_forward.sh]
- #
- # SSH port forwarding script.
- #
- # syntax: ssh -L <local_port>:<destination_address>:<destination_port> <host_address|user@host_address>
- # eg:
- # ssh -L 21121:SkyLake.Centauri.dev:21 phr0z3n@IvyBridge.Centauri.dev
- # ssh -L 21121:SkyLake.Centauri.dev:21 phr0z3n@SkyLake.Centauri.dev # For complete transmission encryption.
- #
- if [ -z "$4" ]; then # If argument 4 is blank...
- echo "Usage: $0 <local_port> <destination_address> <destination_port> <host_address|user@host_address>"
- exit
- fi
- if [ "$5" ]; then # If argument 5 is not blank...
- echo "Usage: $0 <local_port> <destination_address> <destination_port> <host_address|user@host_address>"
- exit
- fi
- ssh -L $1:$2:$3 $4
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement