How are SSH-AGENT and GPG-AGENT startup configured?

Hello,
Using SDDM+MATE+X11

I’m a bit annoyed how SSH-AGENT and GPG-AGENT are started as you can see from the ps -ef output below. (–keep-display setting is unnecessary)

In researching how it is started I am lead to:-
/usr/etc/X11/xdm/scripts/{09-ssh-vars ,10-gpg-agent ,11-ssh-agent}

In 09-ssh-vars the first code line is:
: ${usessh:=yes}

Suggestions in 127687 don’t work for me.

I’d like to know where $usessh would be configured by a User?

Thanks
John

john     1779    1694  0 13:59 ?        00:00:00 /usr/bin/ssh-agent /usr/bin/gpg-agent --sh --daemon --keep-display /usr/libexec/xinit/xinitrc
john     2345    1682  0 13:59 ?        00:00:00 /usr/bin/ssh-agent -D -a /run/user/1000/keyring/.ssh
john     1780    1694  0 13:59 ?        00:00:00 /usr/bin/gpg-agent --sh --daemon --keep-display /usr/libexec/xinit/xinitrc

I think the following is intended…

Create your own script, without execute bit and no shebang

I have this:

# cd /usr/etc/X11/xdm/scripts
# cat 01-john
usessh=no
export usessh
usegpg=no
export usegpg

This gives with ps-ef

john     2355       1  0 17:49 ?        00:00:00 ssh-agent
john    2323       1  0 17:49 ?        00:00:00 gpg-agent --daemon --write-env-file

but where I believe --write-env-file is deprecated.

But I’ve found that removing the three files {09-ssh-vars 10-gpg-agent 11-ssh-agent} is perfectly fine, except that they’ll probably come back with an upgrade.

There’s a ton of ways for this, I think keepassxc also has a way…

I like this one https://www.funtoo.org/Funtoo:Keychain

bashrc

[ -S "${SSH_AUTH_SOCK-}" ] || {
  keychain_dir="${XDG_STATE_HOME:-$HOME/.local/state}/keychain"
  keychain --quiet --quick --agents ssh --absolute --dir "$keychain_dir"
  . "$keychain_dir/$HOSTNAME-sh"
  ssh-add -q ~/.ssh/id_ed25519
}

If authenticated correctly;

$ ssh-add -L
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGLwz9fF2ZL0EGhWMq3YgXi1iMphdgKv+Z0rKsKrPfyC dza@localhost

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.