Heroku 认为我的 ssh 位置错误

Heroku thinks my ssh is in wrong place

当我尝试通过 SSH 连接到 Heroku 时,Heroku 拒绝了我的许可。

我能够成功添加我的密钥,该密钥保存在我的用户根目录中的 ~/.ssh

但是,当 Heroku 尝试连接时,我发现它是出于某种原因在 /c/ChromeBrowser/depot_tools/.ssh/id_dsa 内部查找,而不是我的实际用户根文件夹。

我该如何解决这个问题?

将 ssh 密钥添加到您的 ssh-agent,它应该可以工作。

# add the default ~/.ssh keys to the ssh-agent
ssh-add

# restart the ssh-agent
eval $(ssh-agent)

ssh-add

ssh-add adds RSA or DSA identities to the authentication agent, ssh-agent.
When run without arguments, it adds the files ~/.ssh/id_rsa, ~/.ssh/id_dsa and ~/.ssh/identity.

Alternative file names can be given on the command line


eval $(ssh-agent)

通过调用 eval 加载添加的 ssh-key。

Heroku 将尝试几个密钥(rsa、dsa、...),全部在 %HOME%(或 $HOME)中。
所以你需要检查:

  • Heroku 使用正确的帐户
  • HOME设置为你本地根~/.ssh文件夹的意思,设置为用户环境变量HOMEc:\Users\Robert).

这与 ssh-agent 无关,仅当您的私钥受密码保护时才需要。我建议使用无密码密钥进行测试。
在这里,Heroku 无论如何都找不到正确的密钥。