0

I have installed Ubuntu 11.10. I'm being confused by the ssh-agent behavior: when I enter the command I get the following output:

SSH_AUTH_SOCK=/tmp/ssh-qKBOsDj10698/agent.10698; export SSH_AUTH_SOCK;
SSH_AGENT_PID=10699; export SSH_AGENT_PID;
echo Agent pid 10699;

And that's it, the agent doesn't run. :( Any suggestions?

2 Answers2

2

If you are running ssh-agent by hand, you typically run

ssh-agent bash

. Then in that bash shell it will be able to talk to the agent, and you can use ssh-add to add your ssh-keys. If you are trying to use it within X11, many distros already start the ssh-agent. Try running:

echo $SSH_AGENT_PID
becomingwisest
  • 3,328
  • 20
  • 18
1

The agent is (probably) running (check your ps output - From your example you probably have a copy of ssh-agent running as PID 10699).

If you consult the ssh-agent man page (man ssh-agent) you will find that when you launch ssh-agent from a command line two things happen:

  1. The agent starts
  2. You get some output (specific to the type of shell you're running, or for whatever type of shell you specify) that will set up environment variables to tell ssh how to connect to the agent.

To make your shell swallow the output you want to do something like:

eval `ssh-agent`

or run the commands that it dumped on your terminal manually.


The man page also has details on the other way of launching an agent (ssh-agent [programname] - which will launch [programname] with the appropriate environment variables set).

voretaq7
  • 79,879
  • 17
  • 130
  • 214