Last active
April 2, 2016 06:38
-
-
Save ijin/8cb28ac605eb3d43730393d961a19479 to your computer and use it in GitHub Desktop.
Put public key in ~/.ssh/authorized_keys with mucho ease
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
IFS="$(printf '\n\t')" | |
mkdir -p ~/.ssh | |
if ! [[ -f ~/.ssh/authorized_keys ]]; then | |
echo "Creating new ~/.ssh/authorized_keys" | |
touch ~/.ssh/authorized_keys | |
fi | |
grep -q "$1" ~/.ssh/authorized_keys || echo "$1" >> ~/.ssh/authorized_keys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment