Skip to content

Instantly share code, notes, and snippets.

@john-auld
Created June 7, 2019 11:10
Show Gist options
  • Star 9 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save john-auld/a55ffe44e9965623f530cb487e33cebd to your computer and use it in GitHub Desktop.
Save john-auld/a55ffe44e9965623f530cb487e33cebd to your computer and use it in GitHub Desktop.
SSH Agent for Visual Studio Code on Windows 10

Using ssh-agent with Visual Studio Code on Windows 10

Enable the ssh-agent service

To enable SSH Agent automatically on Windows, start PowerShell as an Administrator and run the following commands:

# Make sure you're running as an Administrator
Set-Service ssh-agent -StartupType Automatic
Start-Service ssh-agent
Get-Service ssh-agent

Adding ssh keys

Run these commands in a terminal window within Visual Studio Code.

Show keys managed by the ssh-agent

ssh-add -l

Add a ssh key

ssh-add

Source article

@john-auld
Copy link
Author

For git, add a system environment variable or use a temporary setting in a PowerShell terminal of VSCode.

$env:GIT_SSH="C:\Windows\System32\OpenSSH\ssh.exe"

@Zawadidone
Copy link

If you add the line $env:GIT_SSH="C:\Windows\System32\OpenSSH\ssh.exe" to your Powershell profile the environment variable will always be used.

notepad $profile

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