Skip to content

Instantly share code, notes, and snippets.

@Kyle-Falconer
Last active August 31, 2016 21:00
Show Gist options
  • Select an option

  • Save Kyle-Falconer/cb5420340e7a08da983cfc7d99aaa241 to your computer and use it in GitHub Desktop.

Select an option

Save Kyle-Falconer/cb5420340e7a08da983cfc7d99aaa241 to your computer and use it in GitHub Desktop.
Upload and append public key to remote computer's authorized_keys
#/bin/sh
# if you need a new public/private key pair, use:
# ssh-keygen
scp ~/.ssh/id_rsa.pub user@example.com:/home/user/.ssh/uploaded_key.pub
ssh user@example.com "echo `cat ~/.ssh/uploaded_key.pub` >> ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment