Skip to content

Instantly share code, notes, and snippets.

@unicornist
Created September 23, 2019 21:04
Show Gist options
  • Save unicornist/a10c0ec8decf90264448a72f5e01d1bb to your computer and use it in GitHub Desktop.
Save unicornist/a10c0ec8decf90264448a72f5e01d1bb to your computer and use it in GitHub Desktop.
ssh-copy-id for Windows

having any kind of command prompt that allows you to run basic linux commands (e.g. CAT) you could do the following:

cat ~/.ssh/id_rsa.pub | ssh user@server "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys"

If you have no id_rsa.pub file you can create one like this:

ssh-keygen -t rsa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment