I am on a Windows 10 Pro machine trying to do a git pull without having to enter my SSH passphrase every time. The key pair was generated, with a passphrase, and the public key was successfully added to my GitLab account.
In the 'Services' GUI I can see that 'OpenSSH Authentication Agent' is running, and in PowerShell if I do Get-Service ssh-agent
I see the following, confirming the same information:
Status Name DisplayName
------ ---- -----------
Running ssh-agent OpenSSH Authentication Agent
When I do ssh -T [email protected]
I get the "Welcome to Gitlab" message indicating a successful ssh connection, without passphrase entry.
I have the ssh agent running and the identity added (by running svn add
, entering my passphrase, and getting a success message). Running "ssh -T [email protected]" in the same terminal succeeds without requiring the passphrase.
In the terminal I can run git commands (such as git push
or git pull
) and I am prompted for my passphrase, every time, and the operation succeeds.
In Visual Studio Code, when I click the GUI button to synchronize with origin, I get the error [email protected]: Permission denied (publickey,keyboard-interactive).
This is likely because it's not prompting for a passphrase and one is required. When I click 'Open Git Log' or 'Show Command Output' I can see the command that was attempted. Running the exact same command in the Terminal within VSCode, or in another terminal type application, I am prompted for the passphrase and after I enter a correct passphrase, the operation succeeds.
The git remote origin url is the SSH URL in the format described here; it is not an HTTPS URL. The second-most-upvoted answer and another one further below on the same question suggest that once able to do an ssh command without passphrase, the git commands also work without a passphrase, and that is NOT what I'm observing here.
My ~./ssh/config
file entries are:
User git
Hostname gitlab.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab_id_ed25519
AddKeysToAgent yes
How do I get git to use the passphrase stored in the ssh-agent instead of prompting every time?