Skip to content

Instantly share code, notes, and snippets.

@andrezrv
Created December 26, 2013 12:00
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrezrv/8132876 to your computer and use it in GitHub Desktop.
Save andrezrv/8132876 to your computer and use it in GitHub Desktop.
Upload your public key to a remote server without using ssh-copy-id (i.e. for Windows/MINGW32 systems).
# Create ssh directory if it doesn't exist
mkdir -p ~/.ssh
# Go to ssh directory
cd !$
# Create public and private keys
ssh-keygen
# Upload your publick key to some server
cat ~/.ssh/id_rsa.pub | ssh user@host -p 22 "cat - >> ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment