Created
March 3, 2017 03:52
-
-
Save gregswift/75e55a742aec2eecafab1531a22cc06b to your computer and use it in GitHub Desktop.
balabit ssh wrapper
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
function enable-bastion() { | |
function ssh() { | |
if [[ $1 == \-v* ]]; then | |
VERBOSITY=${1} | |
TARGET=${2} | |
else | |
unset VERBOSITY | |
TARGET=${1} | |
fi | |
[ -z "$SSO" ] && SSO=${USER} | |
[[ $TARGET != *"@"* ]] && TARGET=${SSO}@${TARGET} | |
[ -z "$BASTION" ] && set-bastion | |
/usr/bin/ssh ${VERBOSITY} gu=${SSO}@${TARGET}@${BASTION} | |
} | |
} | |
function disable-bastion() { | |
unset -f ssh | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment