You are not logged in.

#1 2022-05-03 03:51:03

gudvinr
Member
Registered: 2022-05-03
Posts: 2

[SOLVED] SSH_AUTH_SOCK set by gpg-agent replaced after login

Hello.

I am trying to set up SSH agent as per instruction from wiki.

I created env file ~/.config/environment.d/80_gpg_agent.conf:

PINENTRY=pinentry-qt
SSH_AUTH_SOCK=${XDG_RUNTIME_DIR}/gnupg/S.gpg-agent.ssh

You can't set empty variables in systemd environment so I didn't set SSH_AGENT_PID.

Then, if I don't login into KDE session I have correct value for SSH_AUTH_SOCK:

SSH_AUTH_SOCK=/run/user/1000/gnupg/S.gpg-agent.ssh

But after I log into KDE session, it is ovewritten by this:

SSH_AUTH_SOCK=/run/user/1000/ssh-agent.socket

Since KDE doesn't have built-in SSH-agent I checked following:

  • ssh-agent is not running

  • there is no code that sets SSH_AUTH_SOCK in .bashrc, .profile, /etc/bash.bashrc, /etc/profile or /etc/profile.d/*

  • there are no env variables in /etc/environment or ~/.config/environment.d/* besides one that I set for gpg-agent

  • I use keepassxc that has embedded ssh-agent but I didn't add it to autostart and it is disabled

So, question is, where is it set and how do I stop this from overriding my env?

Last edited by gudvinr (2022-05-05 09:25:16)

Offline

#2 2022-05-05 09:25:00

gudvinr
Member
Registered: 2022-05-03
Posts: 2

Re: [SOLVED] SSH_AUTH_SOCK set by gpg-agent replaced after login

I apparently solved this issue.

After thorough examination I found out that ~/.pam_environment has override for SSH_AUTH_SOCK:

SSH_AUTH_SOCK=${XDG_RUNTIME_DIR}/ssh-agent.socket

Since it is marked as deprecated I didn't even thought it might be used.

Offline

#3 2022-05-05 10:34:50

tucuxi
Member
From: Switzerland
Registered: 2020-03-08
Posts: 291

Re: [SOLVED] SSH_AUTH_SOCK set by gpg-agent replaced after login

Deprecated means that it will stop working at some point in the future and people should switch to an alternative while it still works.

Offline

Board footer

Powered by FluxBB