2

I have configured ssh-agent on many older Ubuntu installations, but today, on my new Ubuntu 16.04 setup, I realized that ssh-add has been working, but I never configured my system to run ssh-agent!

Edit: It's not just that I haven't configured it, it is not even running:

ps aux | grep ssh
root       976  0.0  0.0  65520  5384 ?        Ss   16:04   0:00 /usr/sbin/sshd -D
user123+  6121  0.0  0.0  21292  1016 pts/1    S+   16:50   0:00 grep --color=auto ssh

How is ssh-add working without ssh-agent? What is this magic? I see there is a gnome-keyring-daemon running on my system, but open-ssh isn't integrated with gnome is it?

4
  • Some, but not all, systems come with ssh-agent configured by default. Look at ps aux | grep ssh and env | grep SSH.
    – fkraiem
    Oct 9, 2016 at 20:46
  • I should have mentioned that ssh-agent is not running at all!
    – Dave
    Oct 9, 2016 at 20:47
  • What makes you say this? It very probably is.
    – fkraiem
    Oct 9, 2016 at 20:48
  • It does not appear in ps
    – Dave
    Oct 9, 2016 at 20:52

2 Answers 2

3

Ubuntu uses the gnome-keyring-daemon as an alternative (compatible) implementation of an SSH agent.

It is installed through the package gnome-keyring and started automatically through /etc/xdg/autostart/gnome-keyring-ssh.desktop.

You can see that which process is your SSH agent with sudo lsof $SSH_AUTH_SOCK.

0

The environment variable SSH_AGENT_LAUNCHER expands to the process that launches the ssh-agent.

On my 14.04, by default, after start:

% echo "$SSH_AGENT_LAUNCHER"
upstart

while after killing, and unset-ing the variable(s), and then spawning ssh-agent again:

% echo "$SSH_AGENT_LAUNCHER"
## Nothing, not being set

So at the startup the init process spawns ssh-agent directly or indirectly, and the environment variable SSH_AGENT_LAUNCHER is set accordingly.

6
  • I don't have that env variable set. I do have SSH_AUTH_SOCK=/run/user/1000/keyring/ssh, but that is it.
    – Dave
    Oct 9, 2016 at 21:10
  • @HDave Did you kill ssh-agent afterwards? Also whats the output of printenv | grep SSH?
    – heemayl
    Oct 9, 2016 at 21:11
  • On this machine ssh-agent has never run, and I have never killed it. printenv | grep SSH SSH_AUTH_SOCK=/run/user/1000/keyring/ssh
    – Dave
    Oct 9, 2016 at 21:14
  • @HDave You should also at least have SSH_AGENT_PID, strange!
    – heemayl
    Oct 9, 2016 at 21:15
  • IKR! WTH! I don't get it...
    – Dave
    Oct 9, 2016 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.