Skip to content

Instantly share code, notes, and snippets.

@iZaL
Created September 17, 2017 14:33
Show Gist options
  • Save iZaL/34c09c1f7a23019f714cf54b6f942ba6 to your computer and use it in GitHub Desktop.
Save iZaL/34c09c1f7a23019f714cf54b6f942ba6 to your computer and use it in GitHub Desktop.
cat ~/.ssh/id_rsa.pub | ssh <user>@<hostname> 'cat >> .ssh/authorized_keys && echo "Key copied"'
@iZaL
Copy link
Author

iZaL commented Sep 17, 2017

cat ~/.ssh/id_rsa.pub | ssh <user>@<hostname> 'umask 0077; mkdir -p .ssh; cat >> .ssh/authorized_keys && echo "Key copied"'

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