Bug#1103522: openssh-client: ssh-agent socket created in an unpredictable path

Antoine Le Gonidec <[email protected]>
Newsgroups gmane.linux.debian.devel.ssh
Message-ID <20250508005044.2adfdf99__15344.9466031574$1746658465$gmane$org@hal9000.dotslashplay.it>
> Can you share the output of the following command (run as your normal
> user):
> 
>    systemctl --user cat ssh-agent.socket ssh-agent.service

I get the exact same output as yours, no local overrides here.

> If your output looks the same as above, can you share the output of:
> 
>     systemctl --user status ssh-agent.socket ssh-agent.service
> 
> That would let me see what your local process supervisor believes is
> going on with this service.

○ ssh-agent.socket - OpenSSH Agent socket
     Loaded: loaded (/usr/lib/systemd/user/ssh-agent.socket; enabled; preset:
enabled) Active: inactive (dead)
   Triggers: ● ssh-agent.service
       Docs: man:ssh-agent(1)
     Listen: /run/user/1000/openssh_agent (Stream)

× ssh-agent.service - OpenSSH Agent
     Loaded: loaded (/usr/lib/systemd/user/ssh-agent.service; static)
     Active: failed (Result: exit-code) since Fri 2025-04-18 16:26:54 CEST; 2
weeks 5 days ago Duration: 18min 13.762s
 Invocation: 9e8c3dc015d64454810ba837d4433547
TriggeredBy: ○ ssh-agent.socket
       Docs: man:ssh-agent(1)
   Main PID: 3932465 (code=exited, status=2)
   Mem peak: 1.9M
        CPU: 24ms

> How are you restarting the ssh-agent user service?

I used to restart it with:
systemctl --user restart ssh-agent.service

But since I got bitten by the behaviour I reported, I stopped using the systemd
unit and now start the agent directly from my user ~/.profile:

# Start SSH agent
export SSH_AUTH_SOCK="${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/openssh_agent"
if [ ! -e "$SSH_AUTH_SOCK" ]; then
	ssh-agent -a "$SSH_AUTH_SOCK" >/dev/null
fi

For debugging purposes, I can disable that temporarily and get back to the
systemd unit, maybe try to get more debug output from it.
signature.asc (application/pgp-signature, 228 B)
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQSUsdxM90hewW6X7Jhja3j5HOuA2AUCaBvjxAAKCRBja3j5HOuA
2BUIAP9MHX6xTAGzO3CGNs84eRKZ6flHdmlj7rMzYdLm/YX/pwEA9bVLBgU710hJ
0ISiuzmMtAQZbyA69zOJ+t3CF2TP3gw=
=54TA
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.