heroku - 无法理解 Heroku 中的 ssh 系统

标签 heroku ssh

我无法获得管理 ssh key 的系统。
我想将应用程序推送到 Heroku,所以我尝试推送但出现错误。这是我的日志

    $ git push heroku master
  !  Your key with fingerprint bf:f6:ed:14:9d:cd:52:a2:a3:16:b2:e9:b4:f2:bf:ba is not authorized to access warm-samurai-6574.
  fatal: The remote end hung up unexpectedly
  User@PK /e/examples (master)
  $ heroku keys:add
  Found existing public key: C:/Users/User/.ssh/id_rsa.pub
  Uploading SSH public key C:/Users/User/.ssh/id_rsa.pub
  !This key is already in use by another account. Each account must have a unique key.
  User@PK /e/examples (master)
  $ heroku keys
  === 1 key for denys.medynskyi@gmail.com
  ssh-rsa AAAAB3NzaC...etyxYh4Q== User@PK

每个帐户都有自己的 ssh key 。所以我可以从任何计算机推送,因为 ssh key 正在推送到 heroku ?
heroku 上的每个应用程序都应该有自己的 ssh key 吗?

最佳答案

基本上,您的计算机有一个 SSH key 。但是,其上的 SSH key 与另一个 Heroku 帐户相关联(与您现在使用的帐户不同)。最好的办法是生成一个全新的 SSH key 并将其添加到 Heroku。

只需在您的机器上创建一个新的 SSH key 并将其上传到 Heroku:

$ ssh-keygen

当提示询问您时,请确保将其保存为“/Users/User/.ssh/new_id_rsa.pub”。
$ heroku keys:add /Users/User/.ssh/new_id_rsa.pub 

这应该允许您使用 Heroku。

至于您的其他问题:只要您通过 heroku keys:add 添加计算机的 SSH key ,您就可以从任何计算机推送到 Heroku。 .不,每个应用程序都不需要拥有自己的 SSH key 。

关于heroku - 无法理解 Heroku 中的 ssh 系统,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11358064/

相关文章:

python - 用于 Python 的轻量级 NLP 框架

ssh - Ansible:SSH 错误:unix_listener:对于 Unix 域套接字来说太长

proxy - 单个 SSH SOCKS 5 代理中的多个连接

linux - ssh:连接到主机 X.X.X.X 端口 22:连接超时

ruby-on-rails - Heroku:Rails 服务器永远工作

node.js - Socket io 和 Node 在本地工作但在 heroku 上不起作用

ruby-on-rails - 将 Rails 应用程序推送到 Heroku 时出错

node.js - Heroku + mongoose 连接错误: no primary server found in set

linux - 使用本地系统作为 ssh 客户端和服务器

macos - 全新安装后设置 git