Getting SSH agent passthrough working with VS code
I had frustrations getting SSH agent passthrough working with VS code such that when I was remoted onto a linux box and working with git, I wasn't able to use the git functions inside code as the auth was failing.
Doing the following worked for me at an administrator powershell prompt on your own machine
Set-Service ssh-agent -StartupType Automatic
Once you've got pageant or similar loading your keys then this should all work. You might need to add entries similar to below into your local ssh config file to ForwardAgent yes:
Also make sure that you've got your ssh identity loaded
Use the following to list identities
and the following to add your id_rsa key
"ssh -V" to get the version.
Try using "ssh -vT email@example.com" to test the forwarding.
Due to bugs in the version of openssh v8.6p1 shipped with Windows 11 22H2, I only got this to work using a more recent release https://github.com/PowerShell/Win32-OpenSSH/releases. So if you have problems where once connected you can see the error "get_agent_identities: ssh_fetch_identitylist: communication with agent failed" when doing "ssh -vT firstname.lastname@example.org" to test the forwarding, try updating. I tested and worked with v18.104.22.168p1-Beta.