-
-
Notifications
You must be signed in to change notification settings - Fork 809
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get-SshAgent return always 0 #575
Comments
From PowerShell, what path does this command return |
|
What happens if you run |
When I run
|
That seems promising. The other thing |
|
But Git is still prompting you for your password? I honestly have no idea if Git and Win32-OpenSSH are expected to play nicely together, or how to fix. I'll drop a note over in Git for Windows Gitter to see if someone can help. |
When I launch my powershell session, powershell prompts me my password for my private key.
And Git is still prompting me for my password.
|
The way to get Git to use the new openssh is to set this env var:
You can remove all the SSH stuff from your profile at this point. |
Tx! it's working |
BTW depending on how you set that env var (presumably with the Edit System Variables dialog box) - some apps may not see that change until reboot. So for instance, if you use Visual Studio it should no longer prompt for a passphrase on a repo using ssh. But it "might" require a reboot to get VS to see the new env var. |
It sounds like
|
Using Path might be a bit brittle since folks can grab the OpenSSH-portable package from here and install into a path of their choosing. We could check this way - Get-Command ssh.exe | % FileVersionInfo | ? ProductVersion -match OpenSSH Yup, we can only start the service if it has been registered. If they installed the ZIP from the GH repo, the ssh-agent service won't be registered unless they've run the install-sshd.ps1 script. That said, if they run the following command once from an Admin console, they'll never have to worry about starting ssh-agent again: Get-Service ssh-agent | Set-Service -StartupType Automatic -PassThru | Start-Service I suppose we could provide a warning if we detect that the BTW it isn't a single env var. At my company we use Git with both TFS 2015 and Bitbucket. In order to get the cipher suite to work for both, I use this env var:
And the quotes around the path are needed even if there are no spaces in that path. |
Just stumbled upon this as I was looking for a solution to this very problem. After adding the GIT_SSH environment variable and rebooting, I am now only asked for the password once for each new PowerShell window, and not every time. |
If you have done the following:
You should never be asked for your passphrase. In practice, I have found that I am sometimes asked for a passphrase after a Windows 10 insider build update. That is always because the ssh-agent service isn't running. As soon as I start it, I'm no longer asked for a passphrase. |
@rkeithhill Thank you! Lifesaver! |
If, for some reason, you need to use a 32-bit |
@rkeithhill I tried following your advice in #575 (comment) and ran into a hang, as described in PowerShell/Win32-OpenSSH#1377... I'm not sure if I'm following up in the right place and thought you might have a more expert opinion 🙏 |
It probably because there was a bug in posh-git version 0.7.3 (also in 0.7.3.1). In Get-SshAgent function in GitUtils.ps1, the command |
System Details
0.7.3
/C:\Program Files\WindowsPowerShell\Modules\posh-git
5.1.17134 revision 48
version 2.17.0.windows.1
Issue Description
Since last update of windows (1803),
Start-SshAgent
seems not working.My profile.ps1
Get-SshAgent
return always 0 and Git keeps prompting me for password.The text was updated successfully, but these errors were encountered: