Skip to content

Instantly share code, notes, and snippets.

@traedamatic
Created March 11, 2017 04:12
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 traedamatic/2a137278f700dd1155f8ed11f9f5078d to your computer and use it in GitHub Desktop.
Save traedamatic/2a137278f700dd1155f8ed11f9f5078d to your computer and use it in GitHub Desktop.
Copy SSH key to remote server key-based authentication
# replace the id_rsa.pub with your key file and enter the correct HOSTNAMEANDCONFIG information
cat ~/.ssh/id_rsa.pub | ssh HOSTNAMEANDCONFIG "mkdir .ssh 2>/dev/null; cat >> ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment