Bug 461173 - SSH_AUTH_SOCK is not always set in wayland sessions
Summary: SSH_AUTH_SOCK is not always set in wayland sessions
Status: RESOLVED DOWNSTREAM
Alias: None
Product: plasmashell
Classification: Plasma
Component: Session Management (other bugs)
Version First Reported In: 5.24.0
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-29 19:49 UTC by Ralf Jung
Modified: 2025-01-09 17:02 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Jung 2022-10-29 19:49:01 UTC
SUMMARY
When using Konsole in a wayland KDE session and trying to do this with SSH, I encounter this error:

"Could not open a connection to your authentication agent."

Turns out that the SSH_AUTH_SOCK env var is not set. This used to be always set under X11, but under Wayland that does not always seem to work. I am pretty sure in a previous session I did have working SSH under Wayland, so maybe this is some non-deterministic condition related to the exact order in which services start when the session is brought up.


I can see in "systemctl --user status ssh-agent.service" that the agent is running. In the logs I see the following

Okt 29 21:41:20 r-thinktop agent-launch[19682]: dbus-update-activation-environment: setting SSH_AUTH_SOCK=/run/user/1000/openssh_agent
Okt 29 21:41:20 r-thinktop agent-launch[19682]: dbus-update-activation-environment: setting SSH_AGENT_LAUNCHER=openssh
Okt 29 21:41:20 r-thinktop agent-launch[19678]: SSH_AUTH_SOCK=/run/user/1000/openssh_agent; export SSH_AUTH_SOCK;

so it seems that somehow those environment variables are supposed to make their way into the session proper, and that does not seem to (always) work.


SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux
KDE Plasma Version: 5.26.0
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
Kernel Version: 6.0.0-2-amd64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Xeon® CPU E3-1505M v5 @ 2.80GHz
Memory: 31,2 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics P530
Manufacturer: LENOVO
Product Name: 20ENCTO1WW
System Version: ThinkPad P50
Comment 1 Nicolas Fella 2024-03-18 22:28:47 UTC
Can you clarify the "not always" part?

https://bugs.kde.org/show_bug.cgi?id=483541 says that it's missing when Konsole is launched from global shortcuts but otherwise there.

Are you observing the same or something different?
Comment 2 Shmerl 2024-08-12 05:38:27 UTC
I'm hitting this issue in a bit different way. It was working fine in the Wayland session in Plasma 5.x but now I finally installed Plasma 6.1.3 in Debian testing (using packages from experimental) and ssh-agent.service simply doesn't run automatically after logging in.

If I start it manually as:

systemctl --user start ssh-agent.service

Then ssh-agent starts working in konsole opened *after* that.

How can I enable ssh-agent.service to start automatically in Plasma 6?
Comment 3 Shmerl 2024-09-11 17:39:05 UTC
Looks like this can be caused by missing build dependency on systemd.

See: https://lists.debian.org/debian-qt-kde/2024/09/msg00245.html
Comment 4 TraceyC 2025-01-09 17:02:58 UTC
Thanks for finding that. Closing this since it's a packaging issue in Debian.