我无法获得管理 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/