Fixing Visual Studio Asking for SSH Passphrase Twice on Windows 11

Fixing Visual Studio Asking for SSH Passphrase Twice on Windows 11

If Visual Studio keeps asking for your SSH passphrase (sometimes even twice) and you see errors like:

fatal: ssh variant 'simple' does not support setting port

here’s a quick way to fix it using Windows’ built-in OpenSSH and ssh-agent.


1. Make Git Use Windows OpenSSH

Open a terminal inside Visual Studio (View → Terminal) and run:

git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
git config --global ssh.variant ssh

You can verify it with:

git config --show-origin core.sshCommand
git config --show-origin ssh.variant

You should see:

  • core.sshCommand = C:/Windows/System32/OpenSSH/ssh.exe
  • ssh.variant = ssh

2. Enable the OpenSSH Authentication Agent

This lets Windows remember your SSH key so you don’t type the passphrase every time.

  1. Press Win + R, type services.msc, hit Enter.
  2. Find OpenSSH Authentication Agent.
  3. Right-click → Properties:
    • Startup type: Automatic
    • Click Start if it isn’t running.

3. Add Your SSH Key to the Agent

In PowerShell (or the VS terminal if it’s PowerShell):

ssh-add C:\Users\YOUR_USER\.ssh\id_ed25519

(or id_rsa if that’s your key name/path).

  • Enter your passphrase once.
  • From now on, Visual Studio will use the key via the agent and stop asking every sync/push.

That’s it:
✅ No more ssh variant 'simple' error
✅ No more passphrase prompt every time you sync in Visual Studio