IJHack / QtPass

QtPass is a multi-platform GUI for pass, the standard unix password manager.
https://qtpass.org/
GNU General Public License v3.0
1.03k stars 162 forks source link

QtPass on Wayland Gnome does not show ssh password prompt #515

Open giovi321 opened 4 years ago

giovi321 commented 4 years ago

Running Debian 10 Gnome, QtPass 1.2.3 from Gnome repository. I have just set up a new password-store on my PC with a remote repository (correcly works on another machine with Debian 10 XFCE). From the shell pass git pull and pass git push work properly, but when the commands are issued from the buttons within QtPass the program just goes all "grayed", the status says "Updating password-store" but then it remains like that. Any idea on how could I address the issue? Thanks!

giovi321 commented 4 years ago

Update: I just realized that the git commands issued by QtPass remain active and never end, this is probably why the programs hangs. When i run ps aux | grep git I can see the list of git commands issued by QtPass but never ending. Any idea on how to solve the issue?

giovi321 commented 4 years ago

I just tried to launch qtpass from the terminal, and I realized that it get stuck during git operations because the window with the password prompt does not appear - the password prompt appeared on the terminal though. Could Wayland be the issue here?

cmol commented 4 years ago

I think it depends on your SSH_AUTH_SOCK.

So if you're used to having the passwords for ssh being typed in the terminal, then I'd guess QtPass have no way of handling that.

You could try and see if running an ssh-agent first does the trick.

eval $(ssh-agent) && ssh-add && qtpass

You'll get a $SSH_AUTH_SOCK like:

cmol@bebop:~$ echo $SSH_AUTH_SOCK 
/tmp/ssh-k8e0xf0Avgc2/agent.7848

If you're on a desktop like ubuntu, you should see an SSH_AUTH_SOCK like:

cmol@qui-gon:~$ echo $SSH_AUTH_SOCK 
/run/user/1000/keyring/ssh

without needing to run the above commands.

I btw can't say anything on wayland, but I'd guess this is just normal ssh stuff.

giovi321 commented 4 years ago

@cmol, thank you for the suggestion. Unfortunately this does not solve the issue. I have tried installing pinentry-qt4 as I saw a similar issue from another user but unsuccesfully. Do you have any other idea in mind?

cmol commented 4 years ago

@giovi321 Not really no. Is you ssh key added when you run the commands above or what are the results?

giovi321 commented 4 years ago

@cmol: here are the results,

g@G:~$ eval $(ssh-agent) && ssh-add && qtpass
Agent pid 22620
cmol commented 4 years ago

@giovi321 And nothing happens in the terminal when you're trying to push or pull?

giovi321 commented 4 years ago

@cmol qtpass does not start when issuing that command.

cmol commented 4 years ago

@giovi321 And you do not get prompted for a passphrase in the terminal either? What happens if you just run the two ssh commands? Do you get prompted for your ssh key passphrase and then get a "identity added" message?

giovi321 commented 4 years ago

None of that. If I start qtpass from terminal, I am asked for the ssh passphrase on push or pull, but if I start qtpass with eval $(ssh-agent) && ssh-add && qtpass nothing happens, I just get an Agend pid number and that's it

cmol commented 4 years ago

Well, that's strange. Not entirely sure about that...

giovi321 commented 4 years ago

Thank you for trying to help :) One last information: when I run qtpass from terminal, I always get the following message: Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. Then it starts normally

cmol commented 4 years ago

@annejan I have no idea about wayland. Do you know some stuff here?

giovi321 commented 4 years ago

Hi all, I have changed the topic of the discussion. My personal opinion is that this should be treated as a bug as I could reproduce it exactly in the same way using Debian 10 on Wayland running Gnome. Qtpass simply does not ask for the ssh password prompt on pull and push.

giovi321 commented 4 years ago

Quick update: could reproduce this as well in KDE on wayland.

cmol commented 3 years ago

Just curious, can you try to make an sftp connection to another host that you have a key for, and see if your GUI kicks in and asks for your passphrase?

I gnome (nautilus) you can do ctrl+l (lower case L), and write sftp://address.of.host

Your GUI should find the SSH_AUTH_SOCK (likely a keyring from your machine), and ask for your passphrase in a GUI popup.

I am wondering if there's something different with how wayland looks at envvars. Also, it could be that your system is not creating an ssh keyring.

cmol commented 3 years ago

I made a quick branch to test the SSH_AUTH_SOCK: https://github.com/cmol/QtPass/tree/ssh_testing

https://github.com/cmol/QtPass/commit/7be4d7cec69f606717b7aa2ff58b0f2da7f21b38