Skip to content

Instantly share code, notes, and snippets.

@risha700
Last active September 26, 2019 14:34
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 risha700/73d367e185e665d21303ce947dd6107d to your computer and use it in GitHub Desktop.
Save risha700/73d367e185e665d21303ce947dd6107d to your computer and use it in GitHub Desktop.
cat ~/.ssh/id_rsa.pub | ssh username@remote_host "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod -R go= ~/.ssh && cat >> ~/.ssh/authorized_keys"

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