Created
April 20, 2021 09:16
-
-
Save lek890/446e82e1c37768d93f57954f0c8b1703 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function ssh_jump_aws { | |
if [[ -z $1 ]]; then | |
echo "jump hostname required as parameter 1" | |
return 1 | |
fi | |
if [[ -z $2 ]]; then | |
echo "target hostname required as parameter 2" | |
return 1 | |
fi | |
local jump_host=$1 | |
local target_host=$2 | |
ssh -o ProxyCommand="ssh -W %h:%p '$jump_host'" "ec2-user@$target_host" | |
} | |
ssh_jump_aws $@ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function ssh_jump_aws { | |
if [[ -z $1 ]]; then | |
echo "jump hostname required as parameter 1" | |
return 1 | |
fi | |
if [[ -z $2 ]]; then | |
echo "target hostname required as parameter 2" | |
return 1 | |
fi | |
local jump_host=$1 | |
local target_host=$2 | |
ssh -o ProxyCommand="ssh -W %h:%p '$jump_host'" "ec2-user@$target_host" | |
} | |
ssh_jump_aws $@ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment