Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
Did you check it's not running ps -ef | grep 10699 ? –  Iain Jan 5 '12 at 17:26
    
Ah, apparently it is running... I got confused by the response above. I'm still a n00b on Linux; sorry and thanks for your time! –  Berislav Lopac Jan 5 '12 at 20:34
    
No worries - the answers below will help you anyway. –  Iain Jan 5 '12 at 20:40
add comment

2 Answers

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
share|improve this answer
add comment

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).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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