Skip to content

Instantly share code, notes, and snippets.

@digitup
Created August 19, 2012 18:12
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 digitup/3396822 to your computer and use it in GitHub Desktop.
Save digitup/3396822 to your computer and use it in GitHub Desktop.
Server: Copy a ssh key from local to a remote server.
# found on http://www.howtogeek.com/wiki/Add_Public_SSH_Key_to_Remote_Server_in_a_Single_Command
# generate a key:
ssh-keygen -t rsa
# copy to the remote server.
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
# found on http://www.howtogeek.com/wiki/Add_Public_SSH_Key_to_Remote_Server_in_a_Single_Command
# generate a key:
ssh-keygen -t rsa
# copy to the remote server.
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
# found on http://www.howtogeek.com/wiki/Add_Public_SSH_Key_to_Remote_Server_in_a_Single_Command
# generate a key:
ssh-keygen -t rsa
# copy to the remote server.
cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment