QtPass icon indicating copy to clipboard operation
QtPass copied to clipboard

Git permission denied (publickey)

Open vshl opened this issue 8 years ago • 10 comments

I'm not sure what the problem is, but the git within qtpass has completely stopped working:

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

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

However, pass works as normal in the command-line. I have configured qtpass to use macOS' git binary. I also tried with the homebrew's git binary.

I only have one profile.. the default ~/.password-store/

Afaik, the ssh works as normal as demonstrated by this command:

┌─(18:58) [~/.password-store] git:(master) ✔
└─➜ % ssh -T [email protected]
Hi vshl! You've successfully authenticated, but GitHub does not provide shell access.

Info: qtpass 1.1.6 git 2.10.1 MacGPG2 2.0.30 pass 1.6.5 macOS Sierra 10.12.2

vshl avatar Dec 18 '16 02:12 vshl

It seems like the git executable can't read your ssh key.

Can you see what the location of the git executable in QtPass settings is and compare with the output in commandline of which git

Can you try issuing git commands in your ~/.password-store

annejan avatar Dec 19 '16 10:12 annejan

Current settings for git: /usr/local/bin/git the same as which git (homebrew's git v2.11.0)

screen shot 2016-12-19 at 5 27 28 pm

It seems to work as expected in the command-line.

vshl avatar Dec 20 '16 01:12 vshl

I have tried to reproduce this on macOS 10.12.3 Beta (16D12b) With no luck unfortunately (git works fine for me) . .

I've also asked at my former employer (for whom I initially developed the very first (read only) version of QtPass) and they use the latest release with their git to share project credentials among developers and management without any issue.

It doesn't seem you use any special kind of authentication method such as gpg-agent or something from your screenshot.

I'll try and see if I can get git to fail in some way (environment settings etc) . .

annejan avatar Dec 20 '16 08:12 annejan

Now it's happened on two of my machines. It's almost the same settings as my home macbook. I just remembered this happened soon after the 10.12.2 update, as I just updated my 2nd macbook to it today.

I will try to remove gpg2, git and reinstall them. I have no issues on the command-line however. pass just works fine there.

vshl avatar Dec 20 '16 21:12 vshl

It must have something to do with some environmental settings . . Unfortunately I have no idea what it could be.

annejan avatar Dec 20 '16 21:12 annejan

I have the same issue and it just started on one of my machines. On my other mac it works just fine.

tylerjw avatar Sep 19 '17 05:09 tylerjw

I have the problem on my manjaro. The cli works fine but with QtPass I can't pull or push anything from my repro.

cavemanr avatar May 06 '20 20:05 cavemanr

Are you using some kind of authentication on the git that might cause a deadlock @cavemanr ?

annejan avatar May 06 '20 20:05 annejan

Are you using some kind of authentication on the git that might cause a deadlock @cavemanr ?

No I don't think so. For the authentication I use a smartcard with GPG and how I said from the CLI everything works fine without problems.

cavemanr avatar May 06 '20 20:05 cavemanr

I have the same issue on both my Ubuntu 20.04 and macOS catalina machines. For context:

  1. I use GPG with a yubikey smartcard
  2. I keep my pass db on my github account
  3. I use my yubikey to auth all SSH sessions, such as to github (via gpg ssh auth socket)
  4. I'm running GNOME on wayland, if that matters.

The solution is to just run qtpass from terminal. When it's ran from the GUI in any way (from gnome start-up applications in ubuntu, or gnome app launcher, or from the dock in macOS) then QtPass doesn't get the correct environment variables. Which is most likely the $SSH_AUTH_SOCK and $GPG_TTY environment variables. QtPass should have better handling for this IMHO.

Logicwax avatar May 22 '20 22:05 Logicwax