Skip to content

Instantly share code, notes, and snippets.

@ErnestoRB
Created August 3, 2023 04:37
Show Gist options
  • Save ErnestoRB/29e48b9dfdbaf29150e9798893454714 to your computer and use it in GitHub Desktop.
Save ErnestoRB/29e48b9dfdbaf29150e9798893454714 to your computer and use it in GitHub Desktop.
Change to OpenSSH on Windows git and add ssh-key to agent
# https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement
# By default the ssh-agent service is disabled. Configure it to start automatically.
# Make sure you're running as an Administrator.
Get-Service ssh-agent | Set-Service -StartupType Automatic
# Start the service
Start-Service ssh-agent
# This should return a status of Running
Get-Service ssh-agent
# Now load your key files into ssh-agent
ssh-add $env:USERPROFILE\.ssh\id_ed25519 # change to your desired key
git config --global core.sshCommand "'C:\Windows\System32\OpenSSH\ssh.exe'" # or anywhere where your OpenSSH installation is
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment