Skip to content

Instantly share code, notes, and snippets.

@mstfydmr
Forked from larrybotha/A.markdown
Created April 14, 2018 14:15
Show Gist options
  • Save mstfydmr/cce0d842ed2deb1f54c3c8e020ea69e8 to your computer and use it in GitHub Desktop.
Save mstfydmr/cce0d842ed2deb1f54c3c8e020ea69e8 to your computer and use it in GitHub Desktop.
Add your public SSH key to your server in one command

Add Your Public SSH Key To Your Server In One Command

You will need to create .ssh/authorized_keys if it is not yet on your server.

cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'

Generating Your Own Public Key

Github has an excellent guide on generating SSH keys

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