git clone ssh 权限被拒绝 [英] git clone ssh permission denied

查看:136
本文介绍了git clone ssh 权限被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照 https://help.github.com/articles/generating 中的说明进行操作-ssh-keys并输入

ssh -T git@github.com

我收到消息

Hi username! You've successfully authenticated, but GitHub does not
# provide shell access.

当我尝试使用 ssh 克隆存储库时

When I try to clone a repository using ssh

git clone ssh://github.com/username/repository.git

我明白

Permission denied (publickey).
fatal: The remote end hung up unexpectedly

如果我输入

ssh-add -l

我在 ~/.ssh/id_rsa (RSA)(k2 和 k3)中看到 3 个密钥,其中一个附加了我的电子邮件地址 (k1),其他 2 个密钥.密钥 k3 与 k1 相同

I see 3 keys one attached with my email address (k1) and other 2 inside ~/.ssh/id_rsa (RSA) (k2 and k3). the key k3 is the same of k1

如果我输入

ssh -vT git@github.com

一切都很好……唯一让我想到的就是

everything is fine...the only line that makes me thinking is

debug1: Remote protocol version 2.0, remote software version libssh-0.6.0
debug1: no match: libssh-0.6.0

推荐答案

git clone ssh://github.com/username/repository.git 是错误的.你应该这样做:

git clone ssh://github.com/username/repository.git is wrong. You should be doing:

git clone ssh://git@github.com/username/repository.git

或者更好:

git clone git@github.com:username/repository.git

这篇关于git clone ssh 权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆