Skip to content

Instantly share code, notes, and snippets.

@Alistair1231
Last active September 6, 2023 17:57
Show Gist options
  • Save Alistair1231/a90c10c5906df286c8a0247a20932499 to your computer and use it in GitHub Desktop.
Save Alistair1231/a90c10c5906df286c8a0247a20932499 to your computer and use it in GitHub Desktop.
ssh-copy-id windows
# just copy/paste into powershell and edit variables before pressing enter.
$user="user"; `
$server="example.com"; `
$port=22; `
$file="id_rsa"; `
type $env:USERPROFILE\.ssh\$file.pub | ssh $user@$server -p $port "mkdir -p ~/.ssh && cat >> .ssh/authorized_keys"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment