Heroku项目的git clone失败了

Mor*_*ess 8 git ssh heroku public-key

(在Mac上)我正在尝试从我的新计算机克隆我的项目.我首先生成了ssh密钥对:

heroku keys:add /Users/y/.ssh/heroku_rsa.pub
Run Code Online (Sandbox Code Playgroud)

heroku keys 说明:

ssh-rsa AAAAB3NzaC...B9DjpXg3fb y@server.local
Run Code Online (Sandbox Code Playgroud)

当我尝试克隆我的项目时 git clone git@heroku.com:xyz.git

Cloning into xyz...
Warning: Permanently added the RSA host key for IP address '50.19.85.132' to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

这很奇怪.

编辑:如果我不重命名我的pub密钥文件,那么它的工作原理.不知何故,heroku不喜欢重命名我的密钥..换句话说,使用deault id_rsa.pub名称.

gst*_*oup 15

我遇到了类似的问题.起初,我没有一个名为id_rsa.pub的密钥.我只有一个github的密钥:github_rsa.pub.我跑了heroku keys,发现它确实认出我有钥匙.但显然heroku不喜欢那个github密钥.这是我做的:

$ssh-keygen -t rsa
$heroku keys:clear
$heroku keys:add 
$git clone git@heroku.com:my-app.git -o heroku
Run Code Online (Sandbox Code Playgroud)

这成功下载了项目的所有文件.


Dmi*_*mov 9

看起来您的密钥未加载.默认情况下仅加载默认的命名密钥(id_rsa).使用ssh-add命令加载heroku密钥:

ssh-add ~/.ssh/heroku_rsa
Run Code Online (Sandbox Code Playgroud)