Skip to content

Instantly share code, notes, and snippets.

@Red-Eyed
Last active December 18, 2022 14:25
Show Gist options
  • Save Red-Eyed/7934b799e1735381fdcc9780ebe9194b to your computer and use it in GitHub Desktop.
Save Red-Eyed/7934b799e1735381fdcc9780ebe9194b to your computer and use it in GitHub Desktop.
ssh-copy-id for windows
type ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh && LANG=C sed 's/[\d128-\d255]//g' >> ~/.ssh/authorized_keys && chmod 0600 ~/.ssh/authorized_keys"
@Red-Eyed
Copy link
Author

Red-Eyed commented Apr 3, 2022

LANG=C sed 's/[\d128-\d255]//g' is required to remove non ascii characters, such as BOM

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