创建ssh密钥后,从github clone仓库到本地出现permissoin denied(publickey)错误。
参考官方文档(generating-ssh-keys)的方法来添加ssh密钥到ssh-agent:
连接到ssh-agent:
ssh-agent -s
添加私钥:
ssh-add ~/.ssh/id_rsa
出现Could not open a connection to your authentication agent错误。
需要在连接到ssh-agent前,执行:
ssh-agent bash
这样就能成功的clone了:
$ git clone git@github.com:dnawym/Concurrency.git
Cloning into 'Concurrency'...
Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts.
remote: Counting objects: 35, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 35 (delta 10), reused 34 (delta 9), pack-reused 0
Receiving objects: 100% (35/35), 3.32 KiB | 0 bytes/s, done.
Resolving deltas: 100% (10/10), done.
Checking connectivity... done.