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

No prompt for passphrase for git key on windows. #317

Closed
Wieke opened this issue Aug 5, 2017 · 6 comments
Closed

No prompt for passphrase for git key on windows. #317

Wieke opened this issue Aug 5, 2017 · 6 comments

Comments

@Wieke
Copy link

Wieke commented Aug 5, 2017

Hi

So I'm using qtPass with git for windows. The key I'm using with git has a passphrase. But when qtPass tries to do something involving git it fails to ask me for my passphrase and shows the following error:

Permission denied (publickey). 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

which is the error git shows if you don't enter anything when it asks for a key's passphrase. If I use a key that doesn't have a passphrase the error isn't shown and qtPass works as expected.

Now I'm not exactly sure where the problem lies, but after looking at the links shown below I suspect that SSH needs to be told that it has to use a graphical interface to ask for a password.

https://unix.stackexchange.com/questions/83986/tell-ssh-to-use-a-graphical-prompt-for-key-passphrase

https://stackoverflow.com/questions/10960269/git-ssh-askpass-on-windows

https://github.com/magit/magit/wiki/Pushing-with-Magit-from-Windows#git-gui--askpass

For the time being I'll just disable git in qtPass and sync my password store manually.

@hinneLinks
Copy link

Confiming this issue (Windows 7). I use git with a ssh-key (secured by a password).
In git bash the command git pull asks for a password.

Enter passphrase for key '/c/Users/user/.ssh/id_rsa':

It seems QtPass fails to ask for the password for the ssh-key.

The FAQ (https://qtpass.org/docs/md__f_a_q.html) says:

Git doesn't work on Windows
git for Windows comes with an ssh-askpass compatible command, git gui--askpass (located in /mingw64/libexec/git-core/git-gui--askpass on PortableGit version, presumably some place similar for the installed version).

I tried to use C:\Program Files\Git\mingw64\libexec\git-core\git-gui--askpass as the git command, but then nothing happens when clicking the push or pull buttons (no error-mesage either).

I also tried C:\Program Files\Git\mingw64\libexec\git-core\git-askpass.exe as the git command, then i get the error

fatal: failed to acquire credentials.

Can @annejan elaborate what needs to be done in the FAQ-Entry "Git doesn't work on Windows"?

The workaround from @Wieke works for me, too.

For the time being I'll just disable git in qtPass and sync my password store manually.

@5bentz
Copy link

5bentz commented Feb 7, 2018

The workaround from @Wieke works also for me:

For the time being I'll just disable git in qtPass and sync my password store manually.

Since I don't edit my passwords on Windows, I only use git pull (in powershell for me).

System and tools (installed with chocolatey ;)

  • Windows 7
  • gpg4win 3.0 -- C:/Program Files (x86)/GnuPG/bin/gpg.exe
  • git 2.16 -- C:/Program Files/Git/cmd/git.exe
  • pwgen 2.9 -- C:/Program Files (x86)/PWGen/PWGen.exe

@palonsoro
Copy link

Hello,

A workaround that worked for me is to start a SSH agent in a shell and, then, the qtpass in the same shell. Like this:

c:\>start-ssh-agent.cmd
Removing old ssh-agent sockets
Starting ssh-agent:  done
Enter passphrase for /c/Users/Somebody/.ssh/id_rsa:
Identity added: /c/Users/Somebody/.ssh/id_rsa (/c/Users/Somebody/.ssh/id_rsa)

c:\>"c:\Program Files (x86)\QtPass\qtpass.exe"

Need to test some of the ask pass stuff to see if I get a more elegant solution.

@annejan annejan closed this as completed Jan 24, 2020
@boomlinde
Copy link

Why was this closed as completed? The issue remains.

@annejan
Copy link
Member

annejan commented Oct 17, 2024

Since this is not a QtPass issue but a git client issue, I have closed it four years ago.

@palonsoro
Copy link

@annejan which git client issue? Do you have the link?

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

No branches or pull requests

6 participants