git push heroku master错误权限被拒绝(publickey)

rub*_*pro 4 ruby-on-rails heroku

我是heroku的新手,我无法推动我的rails项目.

我可以成功登录到heroku,我有钥匙

 Keys
 ssh-rsa AAAAB3NzaC...oPiDGoh0Gt root@Slava-System-Product-Name
Run Code Online (Sandbox Code Playgroud)

但是当git push heroku master我收到你的时候

 Permission denied (publickey).
 fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

Luí*_*lho 11

常见的密钥错误是:权限被拒绝(publickey).您可以使用键来解决此问题:添加以通知Heroku您的新密钥.

heroku keys:add ~/.ssh/id_rsa.pub
Run Code Online (Sandbox Code Playgroud)

https://devcenter.heroku.com/articles/keys

更新,以下博客文章的解决方案工作.

  1. 创建一个新的公钥

    ssh-keygen -t rsa

  2. 上传到heroku

    heroku密钥:添加/root/.ssh/id_rsa.pub