Bug 438296

Summary: ssh-agent systemd service not working under wayland
Product: [Plasma] plasmashell Reporter: kskot <288pat0tem>
Component: generalAssignee: David Edmundson <kde>
Status: RESOLVED DOWNSTREAM    
Severity: normal CC: nate, plasma-bugs-null
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.22.0   
Target Milestone: 1.0   
Platform: Neon   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=380311
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: ssh-agent_process_tree

Description kskot 2021-06-08 21:49:04 UTC
SUMMARY
Under wayland, ssh-agent is not started automatically on startup. This works on X11.

Potential solutions:
- Fedora added a patch to openssh-client to create a systemd service: https://bugzilla.redhat.com/show_bug.cgi?id=1761817
- some startup scripts: https://forum.kde.org/viewtopic.php?f=309&t=153769

Older discussion:
https://bugs.kde.org/show_bug.cgi?id=380311
https://bugs.kde.org/show_bug.cgi?id=44177

STEPS TO REPRODUCE
1. Start a wayland session
2. notice that $SSH_AUTH_SOCK is not set

OBSERVED RESULT
ssh-agent needs to be started manually.

EXPECTED RESULT
ssh-agent is running on startup by default without user interaction.
Comment 1 Nate Graham 2021-06-14 15:39:46 UTC
Works fine for me on Fedora 34 with a git master Plasma Wayland session when starting an ssh-agent via the following autostart script:

#!/bin/sh
eval "$(ssh-agent)"
ssh-add -q < /dev/null

How are you doing it?
Comment 2 kskot 2021-06-14 18:57:02 UTC
That is exactly the point. I should not have to start the ssh-agent manually. It should be started automatically without a script created by a user. This is how it works with X11.

"xinit handles launching ssh-agent for plasma" - https://bugzilla.redhat.com/show_bug.cgi?id=1761817
Comment 3 Nate Graham 2021-06-14 21:59:09 UTC
Heh I had no idea that you could do it in any other way.

According to https://src.fedoraproject.org/rpms/openssh/c/5f230a4, the service is called "ssh-agent". What does `systemctl status ssh-agent` say?
Comment 4 kskot 2021-06-14 22:14:27 UTC
Created attachment 139325 [details]
ssh-agent_process_tree
Comment 5 kskot 2021-06-14 22:16:24 UTC
The ssh-agent systemd service is not present on my system (not on X11 and not on wayland). I use KDE neon. I only added the redhat links as potential solution for the problem.

The attached screenshot shows that ssh-agent is started by startplasma-x11 on my system, the same is not true on wayland: startplasma-wayland does not start ssh-agent.
Comment 6 Nate Graham 2021-06-14 22:45:08 UTC
Hmm, it kind of seems to me like this is something that should be done at the distro level or even the openssh level. Otherwise we're unilaterally creating a systemd service for something that's not ours. It would conflict with what Fedora's doing, and would conflict with what the openSSH people would do should it be doe at that level.