Created
October 22, 2021 06:51
-
-
Save Elyorbe/21fd7c3a52686a5aadcb1058483d4e33 to your computer and use it in GitHub Desktop.
ssh-copy-id for windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# First generate public/private key if doesn't exists | |
ssh-keygen | |
# For PowerShell | |
type $ENV:USERPROFILE\.ssh\id_rsa.pub | ssh username@host "cat >> .ssh/authorized_keys" | |
# For CMD | |
type %USERPROFILE%\.ssh\id_rsa.pub | ssh username@host "cat >> .ssh/authorized_keys" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment