Skip to content

Instantly share code, notes, and snippets.

@sagarPakhrin
Created July 16, 2019 04:46
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 sagarPakhrin/a20b9bf7b57c3b42373381b96a0eb351 to your computer and use it in GitHub Desktop.
Save sagarPakhrin/a20b9bf7b57c3b42373381b96a0eb351 to your computer and use it in GitHub Desktop.

Generate ssh key

$ ssh-keygen

Copy the public key to ubuntu server

cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment