GnuPG and SSH_AUTH_SOCK value
Dirk Gottschalk
dirk.gottschalk1980 at googlemail.com
Tue Jun 25 12:53:07 CEST 2019
Hi.
Am Sonntag, den 23.06.2019, 10:21 +0000 schrieb Matthias Apitz:
> El día sábado, junio 22, 2019 a las 09:47:12a. m. +0200, Werner Koch
> via Gnupg-users escribió:
>
> > That seems to be deep in the innards of KDE's X startup or Wayland
> > or
> > Systemd configuration. I try to avoid all this and use the old
> > fashioned but easy to debug ~/.xsession
>
> I'm used to use 'startx' and ~/.xinitrc to bring up Xorg+KDE:
>
> $ cat ~/.xinitrc
>
> # set SSH_AUTH_SOCK
> #
> unset SSH_AGENT_PID
> unset SSH_AUTH_SOCK
> SSH_AUTH_SOCK="$(gpgconf --list-dirs agent-ssh-socket)";
> export SSH_AUTH_SOCK
> echo SSH_AUTH_SOCK: $SSH_AUTH_SOCK >> /tmp/xinit
> #
> setxkbmap de,us -option terminate:ctrl_alt_bksp
> xrandr --output default --mode 1366x768
> /usr/local/bin/xbindkeys
> exec ck-launch-session startkde
>
> The idea is to set env var SSH_AUTH_SOCK correctly for all the
> xterm/urxvt
> processes "below" KDE. But, before the start of KDE (last line) the
> SSH_AUTH_SOCK is still
> /home/guru/.gnupg-ccid/S.gpg-agent.ssh
> and later when KDE is up the 'gpgconf --list-dirs agent-ssh-socket'
> returns /var/run/user/1001/gnupg/d.m4rfaasqebhjmgto9ddm6m7y/S.gpg-
> agent.ssh
> i.e. the env var SSH_AUTH_SOCK is set wrong and I have to reset it
> in any terminal.
I am not running KDE, but Gnome. For my case I have a SystemD user
service which starts a gpg-agent instance in background and sets the
environment variables for the user on login. Originally I found this
solution on the internet and I adapted it for my usecase with a few
modifications.
GPG doesn't start the agent becuse there is already a running instance
and the authentication socket is available. SSH authentication, gpg and
all other things work just fine.
If this is what you want to achieve and if you want to have a look at
this, tell me and I'll send you the needed Files.
Regards,
Dirk
--
Dirk Gottschalk
GPG: 4278 1FCA 035A 9A63 4166 CE11 7544 0AD9 4996 F380
Keybase.io: https://keybase.io/dgottschalk
GitHub: https://github.com/Dirk1980ac
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.gnupg.org/pipermail/gnupg-users/attachments/20190625/1ed09a2a/attachment.sig>
More information about the Gnupg-users
mailing list