Created
December 19, 2018 19:03
-
-
Save fbrinker/9800235361e9e18ec6976e5ddd5408da to your computer and use it in GitHub Desktop.
Add your ssh key to the remotes authorized_keys file
This file contains hidden or 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
#!/usr/bin/env bash | |
USAGE="Usage: script.sh user@remoteserver" | |
if [ $# == 0 ] ; then | |
echo $USAGE | |
exit 1; | |
fi | |
cat ~/.ssh/id_rsa.pub | ssh $1 'tee -a .ssh/authorized_keys' >/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment