Created
March 21, 2022 03:34
-
-
Save garaemon/1d587b9d0bae7486846891f8b8fb53ce 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
function ssh-with-copy-id() { | |
ssh -o "PasswordAuthentication=no" $@ | |
if [ $? != "0" ]; then | |
echo "Failed to ssh w/o password. Copy id_rsa.pub to the machine." | |
ssh-copy-id $@ | |
ssh -o "PasswordAuthentication=no" $@ | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment