The officially official Devuan Forum!

You are not logged in.

#1 2026-08-05 20:10:22

tux_99
Member
Registered: 2025-06-17
Posts: 133  

[SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

I noticed ssh-agent and gpg-agent are running in the background on my Devuan Excalibur XFCE PC, since I have no need for them and I dislike having stuff running in the background that I don't need (no matter how small their RAM or CPU footprint) I tried to figure out where they get started from and how to disable them.

By doing a grep for ssh-agent and gpg-agent in /etc I found the following files:

/etc/X11/Xsession.options
contains a config option "use-ssh-agent" which I commented out, and after that made no difference I replaced the line with "no-use-ssh-agent" (as indicated in the man page), which also had no effect.

/etc/X11/Xsession.d/90x11-common_ssh-agent
this script starts up ssh-agent providing the config option "use-ssh-agent" has been set.
I tried commenting out all the lines of the script but that made no difference, ssh-agent still starts up after a reboot or relogin.

/etc/X11/Xsession.d/90gpg-agent
this script seems to be made to start up gpg-agent.
I tried commenting out all the lines of the script but that made no difference, gpg-agent still starts up after a reboot or relogin.

I also looked in the "Session and Startup" GUI config tool of XFCE but there is no reference to ssh-agent (other than a 'SSH Key Agent' part of 'GNOME Keyring', but I had already unticked this) or gpg-agent.

So I'm at my wits end, what the heck is starting up ssh-agent and gpg-agent during X11 session startup?

Last edited by tux_99 (2026-08-05 20:17:10)


Either the users control the program – or the program controls the users” Richard Stallman

Offline

#2 2026-08-05 20:22:38

rolfie
Member
Registered: 2017-11-25
Posts: 1,488  

Re: [SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

Well I would think about a ssh package first of all.

apt list -i *ssh*

Offline

#3 2026-08-05 20:28:40

greenjeans
Member
Registered: 2017-04-07
Posts: 1,731  
Website

Re: [SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

Well it may be that some other things need one or both of those things running, i'd definitely look into that before shutting them down.

But just spitballing here seems like you could add a couple lines to ~/.xsessionrc to stop them from starting on login.


https://sourceforge.net/projects/vuu-do/ Vuu-do GNU/Linux, Devuan-based Openbox systems.
Devuan 6 mate-mini iso, pure Devuan, 100% no-vuu-do. Now with Xlibre as well.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate
https://devuanusers.com/ Apps source : https://git.devuan.org/greenjeans

Offline

#4 2026-08-05 20:28:54

tux_99
Member
Registered: 2025-06-17
Posts: 133  

Re: [SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

@rolfie What is that command supposed to do, I get no output from it?

I do have the openssh-client package installed (/usr/bin/ssh-agent is included in this package) and I use ssh all the time, but I have no use for ssh-agent.

The ssh-agent weakens ssh security and can be a real security risk:
https://medium.com/@bornaly/why-i-alway … c52573fa2f

@greenjeans in this thread I would like to find out what starts them in the first place so that I can disable them, I can always re-enable them once I know how to disable them (in case I need them).

Last edited by tux_99 (2026-08-05 20:32:25)


Either the users control the program – or the program controls the users” Richard Stallman

Offline

#5 2026-08-05 20:31:53

rolfie
Member
Registered: 2017-11-25
Posts: 1,488  

Re: [SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

This is what I get on my system, Excalibur with Cinnamon DE, openssh-server is installed. Can be run in a user console. root permisson not required. It lists the installed packages that contain the string ssh.

$ apt list -i *ssh*
libssh-4/stable,now 0.11.2-1+deb13u1 amd64  [Installiert,automatisch]
libssh2-1t64/stable,stable-security,now 1.11.1-1+deb13u1 amd64  [Installiert,automatisch]
openssh-client/stable,now 1:10.0p1-7+deb13u4 amd64  [Installiert,automatisch]
openssh-server/stable,now 1:10.0p1-7+deb13u4 amd64  [installiert]
openssh-sftp-server/stable,now 1:10.0p1-7+deb13u4 amd64  [Installiert,automatisch]

Last edited by rolfie (2026-08-05 20:32:57)

Offline

#6 2026-08-05 20:36:09

tux_99
Member
Registered: 2025-06-17
Posts: 133  

Re: [SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

@rolfie that command doesn't work on my system, it runs and then returns to the command prompt without any output.

But it doesn't matter, like I said /usr/bin/ssh-agent is included in the openssh-client package which I do have installed and cannot uninstall as I use ssh all the time. But ssh-agent is not required to use the ssh client, it's 100% optional.

So back to my original question, what is starting up ssh-agent and gpg-agent during X11 session startup?
This is what I'm trying to find out, nothing else.

BTW, the following command gives me the output you were looking for:

$ apt list -i |grep ssh

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libssh-4/stable,now 0.11.2-1+deb13u1 amd64 [installed,automatic]
libssh-4/stable,now 0.11.2-1+deb13u1 i386 [installed,automatic]
libssh2-1t64/stable,stable-security,now 1.11.1-1+deb13u1 amd64 [installed,automatic]
libssh2-1t64/stable,stable-security,now 1.11.1-1+deb13u1 i386 [installed,automatic]
openssh-client/stable,now 1:10.0p1-7+deb13u4 amd64 [installed]
$

Last edited by tux_99 (2026-08-05 20:41:17)


Either the users control the program – or the program controls the users” Richard Stallman

Offline

#7 2026-08-05 20:40:11

rolfie
Member
Registered: 2017-11-25
Posts: 1,488  

Re: [SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

In your initial post it wasn't clear that you use ssh. I thought a fast look at the installed packages might give an entry point. Don't know why it doesn't work on your system. My experience: typos cause empty output.

When you use ssh: can't help with diabling the agent. Sorry, its your game.

Offline

#8 2026-08-05 21:21:44

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 156  

Re: [SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

on my system :

pstree -c | grep -B40 ssh-agent
     |          `-{libvirtd}
     |-lightdm-+-Xorg-+-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      |-{Xorg}
     |         |      `-{Xorg}
     |         |-lightdm-+-x-session-manag-+-at-spi-bus-laun-+-dbus-daemon
     |         |         |                 |                 |-{at-spi-bus-laun}
     |         |         |                 |                 |-{at-spi-bus-laun}
     |         |         |                 |                 `-{at-spi-bus-laun}
     |         |         |                 |-caja-+-{caja}
     |         |         |                 |      |-{caja}
     |         |         |                 |      `-{caja}
     |         |         |                 |-marco-+-{marco}
     |         |         |                 |       |-{marco}
     |         |         |                 |       `-{marco}
     |         |         |                 |-mate-panel-+-mate-terminal-+-zsh---su---zsh-+-grep
     |         |         |                 |            |               |                `-pstree
     |         |         |                 |            |               |-{mate-terminal}
     |         |         |                 |            |               |-{mate-terminal}
     |         |         |                 |            |               `-{mate-terminal}
     |         |         |                 |            |-{mate-panel}
     |         |         |                 |            |-{mate-panel}
     |         |         |                 |            `-{mate-panel}
     |         |         |                 |-mate-screensave-+-{mate-screensave}
     |         |         |                 |                 |-{mate-screensave}
     |         |         |                 |                 `-{mate-screensave}
     |         |         |                 |-mate-settings-d-+-{mate-settings-d}
     |         |         |                 |                 |-{mate-settings-d}
     |         |         |                 |                 |-{mate-settings-d}
     |         |         |                 |                 |-{mate-settings-d}
     |         |         |                 |                 |-{mate-settings-d}
     |         |         |                 |                 `-{mate-settings-d}
     |         |         |                 |-ssh-agent

after closing firefox there was a reasonable display
The clue is in this line _

lightdm-+-x-session-manag-+-at-spi-bus-laun-+-dbus-daemon

The vertical bars originate from x-session-manag-+-at-spi-bus-laun
one of the two
Good luck
YMMV


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#9 2026-08-05 21:26:34

tux_99
Member
Registered: 2025-06-17
Posts: 133  

Re: [SOLVED] How do I disable ssh-agent and gpg-agent from starting automatically?

Ok, after some extensive googling I found the solution in the end:

In the following thread on the linux.debian.user newsgroup a Debian user asked the same question 4 years ago:
https://groups.google.com/g/linux.debia … lSllKEIUVk

After lots of trial and error he finds the solution, it's XFCE starting up both ssh-agent and gpg-agent and annoyingly this is not exposed in the "Session and Startup" GUI config tool of XFCE where I had already looked, it requires using xfconf-query to disable:
https://docs.xfce.org/xfce/xfce4-sessio … gpg_agents

I can confirm that running the following two commands (as indicated in the above XFCE docs link) prevents ssh-agent and gpg-agent from being started automatically by XFCE:

xfconf-query -c xfce4-session -p /startup/ssh-agent/enabled -n -t bool -s false
xfconf-query -c xfce4-session -p /startup/gpg-agent/enabled -n -t bool -s false

Last edited by tux_99 (2026-08-05 21:32:33)


Either the users control the program – or the program controls the users” Richard Stallman

Offline

Board footer