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
SSH key could not be found #12
Comments
On startup, pass-winmenu will check the protocol of your password store's default remote to see if it uses SSH. If that is the case, it'll look for an SSH key in the location configured in This message is there to inform you that, since it couldn't find your SSH keys, pass-winmenu will not be able to do this. I should probably make it more clear that it's not trying to suggest that your repository is set up incorrectly. If you don't use the built-in push/pull functions, you can simply disable the notification by setting I realise that this isn't exactly the best way to handle this, but I can't immediately come up with a better solution, so I'm open to any suggestions. |
Ideally this would all be handled in a slightly more user-friendly manner, see issue #12.
I did assume only the Push/Pull functionality would be affected. I was not sure why the keys were not found as they are located in I renamed the keys to match the expected file names and the warning no longer appears. Still, when triggering the Push/Pull functionality, I get this error: My keys have a passphrase, I wonder if that is the cause of this error. Also, I order to be able to use MINGW64 ~/.password-store (master)
$ echo $GIT_SSH
C:\Program Files\PuTTY\plink.exe |
This is something worth looking into. SSH keys are hard to identify since they can be named pretty much anything, with or without a file extension, so I just went with the default names as Which would end up looking somewhat like this
It most likely is. I haven't implemented passphrases yet, since I'd have to add some hooks to request the passphrase from the user, as well as creating a window where they can enter their passphrase.
Since pass-winmenu uses LibGit2Sharp, I don't believe it honours the same environment variables as git does. It uses its own SSH implementation, which, unfortunately, is still somewhat limited (for instance, ECC keys are not supported yet). |
I see. So delegating the SSH connection and key handling to PuTTY/Pageant might not be straight forward. Pageant has already the key loaded and handles the passphrase. |
I believe so. LibGit2Sharp allows you to define your own SSH credentials provider, which must return the path to a private key file, the path to its public key file, and a password (if applicable). That means the keypair must be requested from Pageant and saved to some temporary files, after which LibGit2Sharp can be pointed to those files. However, at this point you're storing unencrypted SSH keys on your disk, which is obviously not desirable if you've gone through the effort of password-protecting your keys and setting up an SSH agent. It's not impossible, but it's no small task either. On the other hand, extending pass-winmenu so it can request SSH key passwords (and remember them for a set amount of time) itself should be possible, though that does leave users with the issue of having to enter their SSH key password twice; once for SSH/git/etc, and once for pass-winmenu. Despite this, adding support for passphrases is probably a good idea, since it still helps out those who encrypt their SSH keys but do not run an SSH agent. |
I ran into another issue with LibGit2Sharp's SSH implementation; turns out the error you got is more likely being caused by the SSH server and client being unable to agree on a key exchange algorithm. If you check the
As you can see, LibGit2Sharp only offers some rather questionable ciphers, which, on modern SSH servers, are not enabled, and often not even available anymore. At this point I think it's probably a better idea to stop trying to make SSH through LibGit2Sharp work, and instead just allow users to configure pass-winmenu to rely on an installed Git for fetching from/pushing to the remote. If a user enables this feature, LibGit2Sharp will still be used for all offline actions such as committing or rebasing, but for fetching and pushing, native Git will be called. This means that if you're using a special configuration (unusual credentials provider, SSH agent, etc), then as long as it works from the commandline, it will work for pass-winmenu too. |
I've added the native Git feature, so I'll consider this fixed. Feel free to open a new issue if you continue running into synchronisation issues. |
Once I start the application I get this warning in the Notification area:
I have a Pageant running and the key loaded there. I am able to push to my remote Git repository using
git-bash
and the key in Pageant:The text was updated successfully, but these errors were encountered: