Skip to content

Instantly share code, notes, and snippets.

@aaronaddleman
Last active August 29, 2015 14:18
Show Gist options
  • Save aaronaddleman/be69bbf815fd048b0638 to your computer and use it in GitHub Desktop.
Save aaronaddleman/be69bbf815fd048b0638 to your computer and use it in GitHub Desktop.
bash function for mapping ports over jump host
# $1 = username
# $2 = left_port
# $3 = right_port
# $4 = final_port
function p2p {
ssh -At $1@hostone -L $2:localhost:$3 ssh -At hosttwo -L $2:localhost:$3 -At ssh hostthree -L $2:localhost:$4
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment