Skip to content

Instantly share code, notes, and snippets.

@fbrinker
Created December 19, 2018 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fbrinker/9800235361e9e18ec6976e5ddd5408da to your computer and use it in GitHub Desktop.
Save fbrinker/9800235361e9e18ec6976e5ddd5408da to your computer and use it in GitHub Desktop.
Add your ssh key to the remotes authorized_keys file
#!/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