win下给 Git Bash 添加私钥(转载)

网上有好多教程都是让使用 “ssh-add 私匙文件路径 ” 这条命令,

试了一下会报如下错误:Could not open a connection to your authentication agent

Administrator@WIN-HVEG7CTE513 MINGW32 ~
$ exec ssh-agent bash
Administrator@WIN-HVEG7CTE513 MINGW32 ~
$ eval ssh-agent -s
SSH_AUTH_SOCK=/tmp/ssh-xxQEgvgMUMh7/agent.1304; export SSH_AUTH_SOCK;
SSH_AGENT_PID=3768; export SSH_AGENT_PID;
echo Agent pid 3768;
Administrator@WIN-HVEG7CTE513 MINGW32 ~
$ ssh-add "C:\Users\Administrator\key\openssh-key"
Identity added: C:\Users\Administrator\key\openssh-key (C:\Users\Administrator\key\openssh-key)
Administrator@WIN-HVEG7CTE513 MINGW32 /d/git/blog-wenzg.rhcloud.com
$ git clone ssh://*********@*********.rhcloud.com/~/git/blog.git

Cloning into 'blog'...
remote: Counting objects: 4445, done.
remote: Compressing objects: 100% (2323/2323), done.
remote: Total 4445 (delta 2033), reused 4445 (delta 2033)
Receiving objects: 100% (4445/4445), 12.03 MiB | 208.00 KiB/s, done.
Resolving deltas: 100% (2033/2033), done.
Checking connectivity... done.

此条目发表在 git 分类目录。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*


*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>