0

I am attempting to use ssh-agent on Ubuntu 13.10 so that I will not have to enter my passphrase to unlock a key every time I want to use ssh or git.

As you can see below, ssh-agent appears to be restarting for some reason. These commends were executed within a period of less than 5 seconds:

andrew@zaphod:~$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-pqm5J0s70NxG/agent.2820; export SSH_AUTH_SOCK;
SSH_AGENT_PID=2821; export SSH_AGENT_PID;
echo Agent pid 2821;
andrew@zaphod:~$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-VpkOH2WKjT1M/agent.2822; export SSH_AUTH_SOCK;
SSH_AGENT_PID=2823; export SSH_AGENT_PID;
echo Agent pid 2823;
andrew@zaphod:~$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-EQ6X9JHNiBOO/agent.2824; export SSH_AUTH_SOCK;
SSH_AGENT_PID=2825; export SSH_AGENT_PID;
echo Agent pid 2825;
andrew@zaphod:~$ ssh-agent
SSH_AUTH_SOCK=/tmp/ssh-8Iij8kFkaapz/agent.2826; export SSH_AUTH_SOCK;
SSH_AGENT_PID=2827; export SSH_AGENT_PID;
echo Agent pid 2827;
andrew@zaphod:~$ 

My guess is that ssh-agent is crashing, but how would I know? What log file would it log to?

2
  • You can get more information by running ssh-agent -d. This will put ssh-agent in debug mode. – mtak Jun 11 '14 at 20:05
  • maybe try gdb ssh-agent and type run, or strace ssh-agent to go further with debugging – LatinSuD Jun 11 '14 at 20:14
2

You have started the ssh-agent multiple times in parallel. Note that ssh-agent goes to background after starting it, meaning it will detach from the terminal and creating a new process group (which's parent is the init process). See UNIX daemons.

You can verify this using:

ps -F x | grep 'ssh-agent'

The output will look like:

2821 ?        Ss     0:00 ssh-agent
2823 ?        Ss     0:00 ssh-agent
2825 ?        Ss     0:00 ssh-agent
2827 ?        Ss     0:00 ssh-agent
2
  • Implying the daemon "backgrounds" rather than dying – LatinSuD Jun 11 '14 at 20:15
  • Have added that information. – hek2mgl Jun 11 '14 at 20:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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