10
git push heroku master

returns:

ssh_exchange_identification: read: Connection reset by peer      
fatal: The remote end hung up unexpectedly.

This is the first time I've tried to push to heroku.

  • heroku login returns "Authentication successful"
  • ~/.ssh/id_rsa was originally created by the heroku command line client - I ran heroku login for the first time and it asked if I wanted to generate a key.
  • I recreated keys using ssh-keygen -t rsa (as specified here) and then tried again but in vain.
  • Created "authorized_keys" at "~/.ssh" and with my public key in it, no luck.
  • Created /etc/hosts.allow with contents "sshd all", still no luck.

Permissions on the keys are : "-rw-------" Heroku status is O.K. I'm using Mac OS X 10.7.

ssh -vvv myloginname@heroku.com

returns:

OpenSSH_5.6p1, OpenSSL 0.9.8r 8 Feb 2011   
debug1: Reading configuration data /etc/ssh_config  
debug1: Applying options for *  
debug2: ssh_connect: needpriv 0   
debug1: Connecting to heroku.com [50.19.85.132] port 22.   
debug1: Connection established.   
debug3: Not a RSA1 key file ~/.ssh/id_rsa.   
debug2: key_type_from_name: unknown key type '-----BEGIN'   
debug3: key_read: missing keytype    
debug3: key_read: missing whitespace   
debug3: key_read: missing whitespace   
debug3: key_read: missing whitespace    
debug3: key_read: missing whitespace   
debug3: key_read: missing whitespace   
debug3: key_read: missing whitespace  
debug3: key_read: missing whitespace   
debug3: key_read: missing whitespace   
debug3: key_read: missing whitespace   
debug3: key_read: missing whitespace     
debug3: key_read: missing whitespace    
debug3: key_read: missing whitespace     
debug3: key_read: missing whitespace     
debug3: key_read: missing whitespace      
debug3: key_read: missing whitespace       
debug3: key_read: missing whitespace       
debug3: key_read: missing whitespace        
debug3: key_read: missing whitespace           
debug3: key_read: missing whitespace            
debug3: key_read: missing whitespace              
debug3: key_read: missing whitespace               
debug3: key_read: missing whitespace               
debug3: key_read: missing whitespace             
debug3: key_read: missing whitespace           
debug3: key_read: missing whitespace             
debug2: key_type_from_name: unknown key type '-----END'             
debug3: key_read: missing keytype               
debug1: identity file ~/.ssh/id_rsa type 1             
debug1: identity file ~/.ssh/id_rsa-cert type -1            
debug1: identity file ~/.ssh/id_dsa type -1            
debug1: identity file ~/.ssh/id_dsa-cert type -1               
ssh_exchange_identification: read: Connection reset by peer            
4

2 回答 2

3

我有同样的问题(不是在heroku上),而是在我自己的服务器上。

尝试查看/var/log/auth.log 我的~/.ssh/authorized_keys文件由错误的用户拥有

于 2013-11-23T02:02:32.230 回答
-1

如果我尝试

ssh -vvv myloginname@heroku.com

我明白了:

debug2: key_type_from_name: unknown key type '-----END'
...
debug3: check_host_in_hostfile: filename ~/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 1
debug3: check_host_in_hostfile: filename ~/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 2
debug1: Host 'heroku.com' is known and matches the RSA host key.
debug1: Found key in ~/.ssh/known_hosts:1
debug2: bits set: 500/1024
debug1: ssh_rsa_verify: signature correct

你有一个 known_hosts 文件~/.ssh/吗?我的包含heroku.com,50.19.85.154 ssh-rsa和的条目50.19.85.132 ssh-rsa。你有那些吗?

如果你这样做which ssh-keygen了,正在运行什么版本的 ssh-keygen?Heroku Toolbelt 是否应该使用/安装正确的副本?如果不是,也许Heroku 管理密钥文章中的步骤没有创建有效密钥?

于 2012-08-31T10:59:40.227 回答