3

I'm using Ubuntu server 10.04.

ssh-add /foo/cert.pem gave the following output:

Could not open a connection to your authentication agent.

These are my running processes:

ps -aux | grep ssh
Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html
root      1523  0.0  0.0  49260   632 ?        Ss   Dec25   0:00 /usr/sbin/sshd
root     10023  0.0  0.3 141304  6012 ?        Ss   12:58   0:00 sshd: padmin [priv]
padmin   10117  0.0  0.1 141304  2400 ?        S    12:58   0:00 sshd: padmin@pts/1
padmin   11867  0.0  0.0   7628   964 pts/1    S+   13:06   0:00 grep --color=auto ssh
root     31041  0.0  0.3 141264  5884 ?        Ss   11:24   0:00 sshd: padmin [priv]
padmin   31138  0.0  0.1 141264  2312 ?        S    11:25   0:00 sshd: padmin@pts/0
root     31382  0.0  0.3 139240  5844 ?        Ss   11:26   0:00 sshd: padmin [priv]
padmin   31475  0.0  0.1 139372  2488 ?        S    11:27   0:00 sshd: padmin@notty
padmin   31476  0.0  0.0  12468   964 ?        Ss   11:27   0:00 /usr/lib/openssh/sftp-server

These are my environment variables:

$ env | grep SSH
SSH_CLIENT=192.168.1.13 42626 22
SSH_TTY=/dev/pts/1
SSH_CONNECTION=192.168.1.13 42626 192.168.1.2 22

What is wrong? Why can't I add any identities?

kenorb
  • 5,943
  • 1
  • 44
  • 53
theTuxRacer
  • 549
  • 2
  • 9
  • 22

3 Answers3

8

Of course atx answer is right but instead of copying you can run ssh-agent with eval.

eval `ssh-agent -s`
Pawel Dubiel
  • 183
  • 1
  • 7
3

You need to run ssh-agent first. You'll receive output like this:

SSH_AUTH_SOCK=/tmp/ssh-mZueDP7822/agent.7822; export SSH_AUTH_SOCK;
SSH_AGENT_PID=7823; export SSH_AGENT_PID;
echo Agent pid 7823;

Now just paste that into your terminal and add your keys.

atx
  • 1,281
  • 1
  • 9
  • 25
0

You may also use the following syntax:

ssh-agent sh -c 'ssh-add /foo/cert.pem && echo Do some stuff here.'
kenorb
  • 5,943
  • 1
  • 44
  • 53