user7693832
user7693832

Reputation: 6849

Can not `ssh-add` publickey, in spite of excuted the `eval 'ssh-agent -s'`

I tried add the eval 'ssh-agent -s', then ssh-add publickey, but still not work.

peter@peter-PC /cygdrive/e/Ti02
$ eval 'ssh-agent -s'
SSH_AUTH_SOCK=/tmp/ssh-G6me31Q1Onsv/agent.2122; export SSH_AUTH_SOCK;
SSH_AGENT_PID=2123; export SSH_AGENT_PID;
echo Agent pid 2123;

peter@peter-PC /cygdrive/e/Ti02
$ ssh-add ~/.ssh/id_rsa
Could not open a connection to your authentication agent.

peter@peter-PC /cygdrive/e/Ti02
$ 

Upvotes: 0

Views: 82

Answers (1)

phd
phd

Reputation: 94931

Wrong apostrophs: '. Use backticks: ``:

eval `ssh-agent -s`

or $():

eval $(ssh-agent -s)

Upvotes: 1

Related Questions