You are not logged in.

#1 2022-10-28 07:46:01

nklvsvdbflajkhsbdflajshdb
Member
Registered: 2022-10-28
Posts: 2

KeepassXC can't find ssh-agent

In the past, the environment variables regarding the ssh-agent were automatically set and KeepassXC was able to find it and add keys.
This stopped working about 1-2 weeks ago (maybe after an update?).

I am automatically starting the ssh-agent as a user service:

~/.config/systemd/user/ssh-agent.service

[Unit]
Description=SSH key agent

[Service]
Type=simple
Environment=SSH_AUTH_SOCK=%t/ssh-agent.socket
# DISPLAY required for ssh-askpass to work
Environment=DISPLAY=:0
ExecStart=/usr/bin/ssh-agent -D -a $SSH_AUTH_SOCK

[Install]
WantedBy=default.target

In the past, without any configuration, this just worked. KeepassXC was able to find the ssh-agent and happily added keys.

I tried using the eval-approach in my rc files (zshrc and bashrc):

~/.zshrc

...
eval $(ssh-agent)

which printed every time I opened a new shell and, if I understood it correctly, forked the process every time (did i understand that correctly)?

I also tried setting the env-variable manually (as suggested in the wiki):

~/.zprofile

SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/ssh-agent.socket"

Which did not work; actually if I echo SSH_AUTH_SOCK it contains nothing.

How can I fix this issue? What am I missing?

Offline

#2 2022-10-28 08:57:35

astralc
Member
Registered: 2022-09-17
Posts: 127

Re: KeepassXC can't find ssh-agent

You start ssh-agent as service, so you only need to set SSH_AUTH_SOCK in the environment. how it depend by which WM/DE you use if you start it not from your shell.

your .zshrc: you don't need to create new agent (the eval.... ), this line will just make problems.

your .zprofile: you forgot 'export' in the start of the line to make it environment variable.

Offline

#3 2022-10-28 11:54:40

nklvsvdbflajkhsbdflajshdb
Member
Registered: 2022-10-28
Posts: 2

Re: KeepassXC can't find ssh-agent

Thanks a lot! It worked. Can't believe I overlooked such a simple bug.

Does anyone have any idea why the setup worked for ~2 years without the line? Did something change in any packages that used to set these env variables?

Offline

Board footer

Powered by FluxBB