今天研究如何在Windows上使用Jekyll,最后用rsync
同步的时候,需要添加密钥,于是使用ssh-add
命令,可是我收到以下的错误:
$ ssh-add private.pub
Could not open a connection to your authentication agent.
Google了一下,把解决方案分享出来。
Solution
使用ssh-add
之前,要先启动ssh-agent
,启动的方法如下:
eval `ssh-agent`
之后你会看到执行结果:
Agent pid 11476
后面的数字是随机的,这样就代表Agent启动成功了,然后你就可以使用ssh-add
命令了。