Ssh-agent.service not starting

Hi everyone :slight_smile:

I am currently out of ideas what to do in the following situation:

I want to use KeepassXC to provide the keys and passwords for SSH. For that to work, KeepassXC needs the SSH_AUTH_SOCK.
So far so good.

I dont want to start the agent manually every time, so I followed the Arch wiki with how to start the ssh-agent.socket as user service. I basically did:
systemctl --user --now enable ssh-agent.socket

The problem is:
After rebooting, ssh-agent.service is not started, although the ssh-agent.socket is??
When I execute systemctl --user status ssh-agent, this is the output:

â—‹ ssh-agent.service - OpenSSH key agent 
     Loaded: loaded (/usr/lib/systemd/user/ssh-agent.service; indirect; preset: **enabled**) 
     Active: inactive (dead) 
TriggeredBy: **â—Ź** ssh-agent.socket 
       Docs: man:ssh-agent(1) 
             man:ssh-add(1) 
             man:ssh(1)

And systemctl status --user ssh-agent.socket outputs:

systemctl status --user ssh-agent.socket
â—Ź ssh-agent.socket - Socket for the OpenSSH key agent
     Loaded: loaded (/usr/lib/systemd/user/ssh-agent.socket; enabled; preset: enabled)
     Active: active (listening) since Thu 2026-02-19 22:49:49 CET; 3min 26s ago
 Invocation: c9bc8adf694548e98f8cdd2f427c45fb
   Triggers: â—Ź ssh-agent.service
       Docs: man:ssh-agent(1)
     Listen: /run/user/1000/ssh-agent.socket (Stream)

Feb 19 22:49:49 Stolloss systemd[2656]: Listening on Socket for the OpenSSH key agent.

Accordingly, the SSH_AUTH_SOCK is not set and KeepassXC cant connect to the agent.

I already checked and it does work when starting ssh-agent.service manually, sourcing ~/.bashrc and then starting KeepassXC from bash.
I also looked through the journal and dmesg and disabled/enabled the service.

Does anyone have an idea what to do now?

You would usually enable the socket and not the service for ssh-agent. Did you try that?

systemctl enable --user --now ssh-agent.socket

Oh, you’re right. My bad, I actually enabled the socket first. Then when it didnt work, I also enabled the service. (Edited the original post)

Doing systemctl enable --user --now ssh-agent.socket and rebooting still results in the ssh-agent not being started :confused:

It looks like it is started in your output above.

Yes, the socket itself is working, but the ssh-agent.service isnt.
And it seems like KeepassXC needs both to actually find a working socket…

But I just had another idea I tried:
When I did echo $SSH_AUTH_SOCK I actually got /run/user/1000/ssh-agent.socket as output.
I now set that value as override in KeepassXC and after restarting it, it works for ssh.

I’ll restart my laptop once more, maybe I actually dont need the ssh-agent.service active as long as I set the SSH_AUTH_SOCK manually.

EDIT & SOLVED:
I have no frickin clue why, but now the ssh-agent.service is actually starting on boot?!
I still need the override value in KeepassXC, but it works :person_shrugging:

Thanks @dalto for taking the time :slight_smile: