Last active
October 1, 2015 14:42
-
-
Save poweld/120c3041c9d8f26e435a to your computer and use it in GitHub Desktop.
How to make SSH holes
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 deploy_pubkey() { | |
return $( cat ~/.ssh/id_rsa.pub | `which ssh` "$@" 'cat - >> ~/.ssh/authorized_keys' ) | |
} | |
function ssh() | |
{ | |
args="$@" | |
ssh=`which ssh` | |
$ssh -oBatchMode=yes $args : 2>&1 >/dev/null | |
if [ $? -eq 0 ]; then | |
$ssh $args | |
else | |
deploy_pubkey $args | |
if [ $? -eq 0 ]; then | |
$ssh $args | |
else | |
return 1 | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment