我正在尝试使用以下命令行将代码部署到heroku:
git push heroku master
但会出现以下错误:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
我已经上传了我的公共SSH密钥,但仍然会出现此错误。
我正在尝试使用以下命令行将代码部署到heroku:
git push heroku master
但会出现以下错误:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
我已经上传了我的公共SSH密钥,但仍然会出现此错误。
当前回答
只有一个命令有效:
heroku keys:add
如果它不存在的话,它会成为一个。
其他回答
推对我很有效,然后突然停了下来。
如果heroku api正在经历宕机,那么当您尝试推送时会出现此错误。
检查:
https://status.heroku.com/
在极度紧张之前。
要遵循的顺序
$ heroku login
$ ssh-keygen -t rsa
$ heroku keys:add
当执行第二条语句时,它会要求输入,只需按Enter(回车)三次,就会添加一个键。
这个问题困扰了我几天。
这可能会有所帮助。
1) 看看你现在在Heroku有什么钥匙。
$ heroku keys
=== 1 key for joe@example.com
ssh-dss AAAAB8NzaC...DVj3R4Ww== joe@workstation.local
2) 构建~/.ssh/config文件:
$ sudo vim ~/.ssh/config
使用此信息编辑
Host heroku.com
Hostname heroku.com
Port 22
IdentitiesOnly yes
IdentityFile ~/.ssh/ssh-dss # location and name of your private key
TCPKeepAlive yes
User joe@workstation.local
我有同样的问题,因为我没有公钥,所以我做到了:
heroku keys:clear
heroku keys:add
这将生成公钥,然后工作正常
对于那些在Windows7上尝试了上述所有方法但仍然没有成功的人,我做了以下工作:-从Git目录C:\Program Files(x86)\Git\中打开GitBash.exe(不要打开命令提示符,这不起作用)。-如上所述添加以下内容,但必须删除#
Host heroku.com
Hostname heroku.com
Port 22
IdentitiesOnly yes
IdentityFile ~/.ssh/ssh-dss
TCPKeepAlive yes
User joe@workstation.local
现在运行gitpushherokumaster,它应该可以工作了。