Heroku に git push したら Permission denied (publickey). のエラーが発生した。
Heroku で git push で Permission denied (publickey). のエラーが発生した。
C:\Documents and Settings\user\workHeroku\hoge>git push heroku master Permission denied (publickey). fatal: The remote end hung up unexpectedly
結構ハマってました。teratermで生成したsshキーがまずかったみたい。
msysgitで生成したsshキーを使ったら上手くいきました。
以下のmsysgitをダウンロードし、インストールします。
http://code.google.com/p/msysgit/downloads/list
以下のコマンドで、sshキーを生成します。
C:\cygwin\home\user\.ssh>ssh-keygen -t rsa -C "yourmailaddress@mail.com" Generating public/private rsa key pair. Enter file in which to save the key: Enter passphrase (empty for no passphrase):
Herokuにsshキーを登録します。
heroku keys:add "ssh key path"
無事 git push できました。
C:\Documents and Settings\user\workHeroku\nissan>git push heroku master Enter passphrase for key '/home/user/.ssh/id_rsa': Counting objects: 6, done. Delta compression using up to 2 threads. Compressing objects: 100% (4/4), done. Writing objects: 100% (6/6), 632 bytes, done. Total 6 (delta 0), reused 0 (delta 0)
-
-
-
-
- > Heroku receiving push
- > Sinatra app detected
- > Gemfile detected, running Bundler version 1.0.7
-
-
-
-
-
-
-
- > Compiled slug size is 420K
- > Launching... done, v4
-
-
-
参考
Heroku - Managing Your SSH Keys http://devcenter.heroku.com/articles/keys