Today I was writing a Windows batch script that would at some stage run git pull
.
When I ran the script it paused and displayed the message:
Enter passphrase for key: 'c/Users/Administrator/.ssh/id_rsa'
No matter how many times I entered the passphrase Windows would not remember it and the prompt would appear again.
So, after some time on Google and some trial and error, I was able to fix the issue and so for anyone else that has the same issue or indeed for me from the future here are those steps.
Enable the OpenSSH Authentication Agent service and make it start automatically.
Add your SSH key to the agent with ssh-add
at C:\Users\Administrator\.ssh
.
Test git integration by doing a git pull
from the command line and enter the passphrase
Enter your passphrase when asked during a git pull
command.
Add an environment variable for GIT_SSH
`setx GIT_SSH C:\Windows\System32\OpenSSH\ssh.exe`
Once these steps were done all was fine and no prompt came up again.
Success ๐
Top comments (0)