Skip to content

Instantly share code, notes, and snippets.

@0xBADC0FFEE
Last active November 3, 2016 13:40
Show Gist options
  • Save 0xBADC0FFEE/fdeff35fca08060b88bbf56895b31767 to your computer and use it in GitHub Desktop.
Save 0xBADC0FFEE/fdeff35fca08060b88bbf56895b31767 to your computer and use it in GitHub Desktop.
Set Up SSH Keys
# local
cat ~/.ssh/id_rsa.pub | ssh user@ip "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"
# remote
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
# both
cat ~/.ssh/id_rsa.pub | ssh user@ip "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod 600 ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment