Bug 1207402 - kwallet does not prompt when using grsync
Summary: kwallet does not prompt when using grsync
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: KDE Workspace (Plasma) (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Pedro Monreal Gonzalez
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-23 10:46 UTC by flint fire
Modified: 2023-11-16 14:04 UTC (History)
4 users (show)

See Also:
Found By: Community User
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description flint fire 2023-01-23 10:46:12 UTC
apps: kwallet, ksshaskpass, grsync
1. dolphin connects via smb to smb-server. kwallet prompts correctly for pw.
2. use grsync to sync files from local to smb-server.
3. No matter which way (with "-e ssh" or without), kwallet does NOT prompt for pw (nor for fingerprint).
4. copy the exact same command (rsync -r -t -v --progress -e ssh <source> <dest>) into terminal and it asks for pw inside terminal and the sync works. 
5. bypass kwallet and use grsync with "--password-file=pw" and the sync works.

(Tumbleweed 20230119, KDE plasma 5.26.5)
Comment 1 flint fire 2023-01-23 10:52:29 UTC
cross-check with KDE-neon installation. ksshaskpass is correctly prompting when sync with grsync starts.
Comment 2 Fabian Vogt 2023-01-23 10:58:19 UTC
Is $SSH_ASKPASS set?
Comment 3 flint fire 2023-01-23 11:10:34 UTC
(In reply to Fabian Vogt from comment #2)
> Is $SSH_ASKPASS set?

Where should that be set? In grsync.ini?
Comment 4 Fabian Vogt 2023-01-23 11:57:21 UTC
(In reply to flint fire from comment #3)
> (In reply to Fabian Vogt from comment #2)
> > Is $SSH_ASKPASS set?
> 
> Where should that be set? In grsync.ini?

As environment variable.

Does it work with SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>?
Comment 5 flint fire 2023-01-23 13:08:26 UTC
(In reply to Fabian Vogt from comment #4)
> (In reply to flint fire from comment #3)
> > (In reply to Fabian Vogt from comment #2)
> > > Is $SSH_ASKPASS set?
> > 
> > Where should that be set? In grsync.ini?
> 
> As environment variable.
> 
> Does it work with SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v
> --progress -e ssh <source> <dest>?

In the file: /etc/sysconfig/ssh

I added & tested the following settings/lines (one after one):
1) SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass
-did not work. I think "ssh-askpass" was installed by me and is not in the default installation, because it simply points to ksshaskpass.
2) SSH_ASKPASS=/usr/libexec/ssh/ksshaskpass
- did not work.
3) SSHD_ASKPASS=/usr/libexec/ssh/ksshaskpass
- did not work. I thought it's worth a try.
4) SSHD_ASKPASS=/usr/libexec/ssh/ssh-askpass
-did not work. I thought it's worth a try.

To be sure I did a restart after every change of /etc/sysconfig/ssh.

On an older pc, I also have Leap 15.4 installed. There the sync with grsync and "-e ssh" works just fine. But on that linux in the file /etc/sysconfig/ssh there is no special/additional setting or line existing, so could it be that we are at the wrong spot?
Comment 6 Fabian Vogt 2023-01-23 13:10:29 UTC
(In reply to flint fire from comment #5)
> (In reply to Fabian Vogt from comment #4)
> > (In reply to flint fire from comment #3)
> > > (In reply to Fabian Vogt from comment #2)
> > > > Is $SSH_ASKPASS set?
> > > 
> > > Where should that be set? In grsync.ini?
> > 
> > As environment variable.
> > 
> > Does it work with SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v
> > --progress -e ssh <source> <dest>?
> 
> In the file: /etc/sysconfig/ssh

I don't know what that file is for, but it looks unrelated to SSH_ASKPASS. Please run

SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>

as command.
Comment 7 flint fire 2023-01-23 13:11:59 UTC
please read point 4. in my very first post:
"4. copy the exact same command (rsync -r -t -v --progress -e ssh <source> <dest>) into terminal and it asks for pw inside terminal and the sync works. "
Comment 8 Fabian Vogt 2023-01-23 13:14:07 UTC
(In reply to flint fire from comment #7)
> please read point 4. in my very first post:
> "4. copy the exact same command (rsync -r -t -v --progress -e ssh <source>
> <dest>) into terminal and it asks for pw inside terminal and the sync works.
> "

That's without the "SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass" part in the beginning.
Comment 9 flint fire 2023-01-23 13:32:43 UTC
as commands in the konsole:

1. 
SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>

2.
SSH_ASKPASS=/usr/libexec/ssh/ksshaskpass rsync -r -t -v --progress -e ssh <source> <dest>

3.
rsync -r -t -v --progress -e ssh <source> <dest>

in the konsole it asks for the pw, after enter it syncs fine. All ok, no errors and no difference between 1.-3.
There is no prompt from the kwallet window outside the konsole or so (what I don't expect), if you were looking for that?
Comment 10 Fabian Vogt 2023-01-23 13:36:26 UTC
(In reply to flint fire from comment #9)
> as commands in the konsole:
> 
> 1. 
> SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh
> <source> <dest>
> 
> 2.
> SSH_ASKPASS=/usr/libexec/ssh/ksshaskpass rsync -r -t -v --progress -e ssh
> <source> <dest>
> 
> 3.
> rsync -r -t -v --progress -e ssh <source> <dest>
> 
> in the konsole it asks for the pw, after enter it syncs fine. All ok, no
> errors and no difference between 1.-3.
> There is no prompt from the kwallet window outside the konsole or so (what I
> don't expect), if you were looking for that?

Yep! What's with this?

SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>
Comment 11 flint fire 2023-01-23 13:51:42 UTC
Getting interesting. Command:

SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>

brings up error:

qt.qpa.plugin: Could not load the qt platform plugin  "xcb" in "" even thought it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Comment 12 Fabian Vogt 2023-01-23 13:56:43 UTC
(In reply to flint fire from comment #11)
> Getting interesting. Command:
> 
> SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r
> -t -v --progress -e ssh <source> <dest>
> 
> brings up error:
> 
> qt.qpa.plugin: Could not load the qt platform plugin  "xcb" in "" even
> thought it was found.
> This application failed to start because no Qt platform plugin could be
> initialized. Reinstalling the application may fix this problem.

That means you're calling it from a context which is not able to connect to the X server. Is this inside a sudo session or something? That won't work with kwallet.
Comment 13 flint fire 2023-01-23 15:06:41 UTC
(In reply to Fabian Vogt from comment #12)
> 
> That means you're calling it from a context which is not able to connect to
> the X server. Is this inside a sudo session or something? That won't work
> with kwallet.

As normal user, I start konsole and paste-in:

in Leap 15.4:
SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/lib/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>

=>new popup window outside of konsole comes up and kwallet needs permission. After klick allow, sync starts and is ok.


In Tumbleweed:
SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>

=>above described error message. No popup-window. No sync. Also same result as superuser in konsole.
Comment 14 Fabian Vogt 2023-01-23 15:18:16 UTC
(In reply to flint fire from comment #13)
> (In reply to Fabian Vogt from comment #12)
> > 
> > That means you're calling it from a context which is not able to connect to
> > the X server. Is this inside a sudo session or something? That won't work
> > with kwallet.
> 
> As normal user, I start konsole and paste-in:
> 
> in Leap 15.4:
> SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/lib/ssh/ssh-askpass rsync -r -t
> -v --progress -e ssh <source> <dest>
> 
> =>new popup window outside of konsole comes up and kwallet needs permission.
> After klick allow, sync starts and is ok.
> 
> 
> In Tumbleweed:
> SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r
> -t -v --progress -e ssh <source> <dest>
> 
> =>above described error message. No popup-window. No sync. Also same result
> as superuser in konsole.

But you can call "kdialog --msgbox Hi", right? Does it work if you do

SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass ssh <source> <dest>

i.e. without rsync?
Comment 15 flint fire 2023-01-23 15:23:52 UTC
in konsole:

kdialog --msgbox Hi

=>new popup window outside of konsole comes up with "Hi" in it. Click ok.
Comment 16 flint fire 2023-01-23 15:44:36 UTC
in konsole:

SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass ssh <user>@192.168.1.110

=>new popup window outside of konsole comes up. Kwallet service > allow. ksshaskpass is asking for pw. Put in pw and ok (at the end permission gets denied because admin per ssh is on server not available. But [as described] sync per ssh is ok.)
Comment 17 Fabian Vogt 2023-01-23 15:56:17 UTC
(In reply to flint fire from comment #16)
> in konsole:
> 
> SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass ssh
> <user>@192.168.1.110
> 
> =>new popup window outside of konsole comes up. Kwallet service > allow.
> ksshaskpass is asking for pw. Put in pw and ok (at the end permission gets
> denied because admin per ssh is on server not available. But [as described]
> sync per ssh is ok.)

Ok, so it looks like rsync is not forwarding the necessary environment to SSH? Reassigning.
Comment 18 flint fire 2023-02-03 10:02:00 UTC
for completion:
All these test were done with rsync --version 3.2.7 protocol version 31
Comment 19 flint fire 2023-11-16 13:30:18 UTC
Info:
Today redone tests with up-to-date Tumbleweed (20231114) and it's still not working. KWallet is not passing the necessary pw to grsync and so grsync shows "Permission denied" error. Per konsole rsync works fine when typing in the pw.
Comment 21 flint fire 2023-11-16 14:04:07 UTC
Update:
1) In Tumbleweed with X11
1a) in konsole command:
SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>

=>Error: Could not load the qt platform...(see full message above)

2) In Tumbleweed with WAYLAND
2a) in konsole command (same as above):
SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass rsync -r -t -v --progress -e ssh <source> <dest>

=>WORKS (no error): KDE Wallet Service pop-up window appears. Put in pw, sync works and all ok.

2b) in grsync with additional options setting:
SSH_ASKPASS_REQUIRE=force SSH_ASKPASS=/usr/libexec/ssh/ssh-askpass -e ssh

=>Error: No asking for pw. Error no permission.