[英]heroku - rails - Permission denied (publickey)
heroku create
Creating floating-planet-1824......................... done, stack is bamboo-mri-1.9.2
http://floating-planet-1824.heroku.com/ | git@heroku.com:floating-planet-1824.git
git push heroku master
Warning: Permanently added the RSA host key for IP address '50.19.85.156' to the list of known hosts.
Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
I generated ssh keys ok. 我生成了ssh键确定。
Rebooting didn't help. 重新启动没有帮助。
It turned out that 结果表明
heroku keys:add ~/.ssh/id_rsa.pub
worked. 工作。
this is how i solved mine 这就是我如何解决我的问题
$ heroku keys:clear
Removing all SSH keys... done
$ heroku login
after clearing all previous ssh. 清除所有以前的ssh后。
heroku login
's uploads back my ssh public key and i can happily git push heroku master
back heroku login
上传了我的ssh公钥,我很乐意git push heroku master
Assuming you already have a public and a private key to use in your ~/.ssh
folder, there might be two different scenarios: 假设您已经在
~/.ssh
文件夹中使用了公钥和~/.ssh
,则可能存在两种不同的情况:
heroku keys:add ~/.ssh/your_public_key
heroku keys:add ~/.ssh/your_public_key
Or you did, but you don't have your identities loaded into your SSH authentication agent. 或者你做了,但你没有将你的身份加载到SSH身份验证代理中。 Solution, execute:
解决方案,执行:
ssh-add -K ~/.ssh/your_private_key # OSX
ssh-add -k ~/.ssh/your_private_key # Ubuntu
and enter your passphrase, so you can use your private key . 并输入您的密码,以便您可以使用您的私钥 。
The problem which i face was setting the ssh environment variable. 我面临的问题是设置ssh环境变量。
SSH_AUTH_SOCK=0
heroku keys
will show the keys, remove and then login, it will create one for you and add to your app. 将显示密钥,删除然后登录,它将为您创建一个并添加到您的应用程序。 Or you can create your rsa key with your email and then use it using
或者,您可以使用电子邮件创建rsa密钥,然后使用它
heroku keys:add /path
Generate key using ssh-keygen -t rsa -C "your_email@youremail.com"
使用
ssh-keygen -t rsa -C "your_email@youremail.com"
生成密钥
In case others are facing the same problem: using standalone toolbelt on fedora 16-17 with rmv 1.17.3 and system ruby 1.9.3p392, just clearing heroku keys and credentials was not sufficient, and I tested that the issue was not with my ssh keychain. 如果其他人面临同样的问题:在fedora 16-17上使用rmv 1.17.3和系统ruby 1.9.3p392使用独立工具带,只清除heroku密钥和凭据是不够的,我测试的问题不在于我的ssh钥匙扣。 If anyone has faced similar issues, and is more familiar with the heroku toolbelt, I posted a new issue here .
如果有人遇到类似的问题,并且更熟悉heroku工具带,我在这里发布了一个新问题 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.