Skip to content

Instantly share code, notes, and snippets.

@igorescobar
Last active October 13, 2015 17:47
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 igorescobar/4232886 to your computer and use it in GitHub Desktop.
Save igorescobar/4232886 to your computer and use it in GitHub Desktop.
Putting your public key into server's authorized keys.
scp -P 5022 ~/.ssh/id_rsa.pub USER@IP_SERVER:~/.ssh/authorized_keys
@isavcic
Copy link

isavcic commented Aug 26, 2013

You will overwrite the authorized keys that way.

Better:

cat ~/.ssh/id_rsa.pub | ssh -p 5022 USER@IP_SERVER "cat >> ~/.ssh/authorized_keys"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment