LoginSignup
6

More than 5 years have passed since last update.

`heroku push origin master` でPermission deniedエラー

Posted at

なぜか突然pushできなくなって困った。
```
$ git push heroku master
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
```

解決策ここに乗ってた。
ruby on rails - git push heroku master permission denied - Stack Overflow

から

Managing Your SSH Keys | Heroku Dev Center

$ heroku keys:add

すると、このような結果になり、
git push heroku masterも成功。
なんだったんだ…

$ heroku keys:add
Found the following SSH public keys:
1) id_dsa.pub
2) id_rsa.pub
Which would you like to use with your Heroku account? 2
Uploading SSH public key /Users/~/.ssh/id_rsa.pub... done
$ git push heroku master
Counting objects: 27, done.

ちなみに、なぜかheroku keys:addでエラーがでた。
でも再トライしたら、2度目は成功した。なんなんだろー。

$ heroku keys:add 2
Uploading SSH public key 2... failed
 !    Could not upload SSH public key: key file '2' does not exist

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6