Skip to content
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

Pageant error at startup: Couldn't load this key (unable to open file) #249

Closed
sryze opened this issue Jan 17, 2016 · 5 comments · Fixed by #255
Closed

Pageant error at startup: Couldn't load this key (unable to open file) #249

sryze opened this issue Jan 17, 2016 · 5 comments · Fixed by #255

Comments

@sryze
Copy link

sryze commented Jan 17, 2016

When Powershell is started Pageant pops up an error saying "Couldn't load this key (unable to open file)":

error

What key is it talking about? Do I need to set it somewhere?

@theaquamarine
Copy link
Collaborator

That's the error pageant gives when it tries to open a non-existent file. By default, posh-git will try to load pageant with any .ppk files in $Env:Home.ssh, but having no keys there just means it won't be given any as arguments. Are you calling Add-SshKey anywhere in your profile?

@sryze
Copy link
Author

sryze commented Feb 14, 2016

I have only this in my Microsoft.Powershell.Profile.ps1:

try { $null = gcm pshazz -ea stop; pshazz init 'default' } catch { }

# Load posh-git example profile
. 'C:\Users\user\Documents\WindowsPowerShell\Modules\posh-git\profile.example.ps1'

Could this be because the SSH keys in .ssh are password protected?

@febaoshan
Copy link

That happened when reinstall my system. After I deployed the tortoisGit, it showed me the tips when I used 'Git pull' or other code.

Then I searched this issue, but it did not resole my problem. Fortunately, I recognised that whether it was the problem of the old configuration? So, I opened the 'config' file of my project, deleted the 'puttykeyfile' line.

...!

Resolved!

Hoping to help you!

ps: project dictionary -> .git -> config -> puttykeyfile

@aggieben
Copy link

I'm also having this issue, but the keys I want to load are definitely there. I have one key in $env:HOME\.ssh that loads just fine: ben.collins@acm.org.ppk, but I put another one there that fails: sb.ppk. When sb.ppk is present, I experience the issue, but when it is absent, I do not. Also, sb.ppk loads just fine when I add it manually using pagent in the Windows system tray.

aggieben referenced this issue May 10, 2016
Handling multiple pageant keys and keys with spaces in didn't work
properly, now fixed and functioning in a more powershell-y way.
@dvdvideo1234
Copy link

Delete all keys from the putty agent and restart it ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants