# [solved] ssh-agent and ssh-add problems

## hooliz

Hey, i think i have a problem with ssh-agent and ssh-add

it appears as follows:

 *Quote:*   

> serv .ssh # ssh-agent
> 
> SSH_AUTH_SOCK=/tmp/ssh-aoAREl1818/agent.1818; export SSH_AUTH_SOCK;
> 
> SSH_AGENT_PID=1819; export SSH_AGENT_PID;
> ...

 

it looks like it runs ok but 

 *Quote:*   

> 
> 
> serv .ssh # ssh-add
> 
> Could not open a connection to your authentication agent.
> ...

 

and finally killing ssh-agent says 

 *Quote:*   

> 
> 
> serv .ssh # ssh-agent -k
> 
> SSH_AGENT_PID not set, cannot kill agent
> ...

 

the socket looks like it is in place 

 *Quote:*   

> 
> 
> serv .ssh # ls /tmp/ssh-aoAREl1818/agent.1818
> 
> 

 

do you have any ideas what am i doing wrong ... ?Last edited by hooliz on Thu Apr 10, 2008 6:24 pm; edited 1 time in total

----------

## Hu

You are starting the agent incorrectly.  It prints out the shell commands necessary to set up the environment for future programs to find the agent.  Since you did not set those environment variables, subsequent programs, including ssh-agent -k, cannot find the original agent to interact with it.  As noted in the manual, you should start it with eval `ssh-agent` so that the output is used to update your environment.

----------

## hooliz

yep you were right i tried it with 'ssh-add' instead `ssh-add` that's what confused me.... thanx

----------

