github上添加了两个ssh keys时出现的问题

from:http://cache.baiducontent.com/c?m=9d78d513d98116ef07b6d53f564b8b711925d634608c874368d4e25f93154c403724a4eb7979415d848e6b6770b8492bfdf04726644573e98cc9f85ddcc885285ed97a732e4a9141638f44e9dc46548177c30cfeaf68b3faad6d84aea393880b0e8c04127af1b0dc185d559129ad547af4a7e95f152804fdad6e6aa51f316b882233ab5ab8a6613f5edcb28a1c189d77957611e0fe68ef2351f244e559407918e151b20d552634eb4921e21e6a44cfb21af02a0f0274f617e8f880edb6149bdc9c67cfa690f87982609087ada92f19210bad6ea9abcbe66e22165ccecaa8479975e2acfbba3ab54991075ccc1d217c3dd96be2d6cf0aad755a82a73fa17464713f0aa9f323bd28313477f5&p=c26f890585cc43ff57ec91271756&newp=882a9440c5871feb0be29625525792695d0fc20e3ad5d2063b8ad7&user=baidu&fm=sc&query=Permission+denied+%28publickey%29%2E+fatal%3A+Could+not+read+from+remote+repository%2E&qid=821ea5db00002d08&p1=1



当你在github后台添加了一个ssh key之后,你可以在本地git clone 然后输入这个账号密码进行clone


然后你又有了第二个ssh key,然后你把开始的那个ssh keys删掉,重新git clone,这个时候本地clone时总会出现错误:


Cloning into 'yershop'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.


这个时候,你需要做的是把你第二次生成ssh key在添加到本地的ssh中:


andy@AndyMacBookPro:/usr/local/webdata$ ssh-add ~/.ssh/secondsshkey
Enter passphrase for /Users/andy/.ssh/secondsshkey:
Bad passphrase, try again for /Users/andy/.ssh/secondsshkey:
Identity added: /Users/andy/.ssh/qdujunjie (/Users/andy/.ssh/secondsshkey)


然后重新 git clone 就可以通过验证了~~~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值