0

I'm using heroku 12.04 and trying to run

$ git push heroku master 

but i get the next error:

ssh: connect to host heroku.com port 22: Connection refused

if i try

$ ssh git@github.com 

i get the same error

I looked for other questions on this matter and haven't figured it out yet, but this is some of the things I've checked:

  1. i have openssh-server installed

  2. $ service ssh status
    ssh start/running, process 8819

  3. $ service sshd start
    sshd: unrecognized service

  4. $ ssh -vvv localhost
    OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
    debug1: Reading configuration data /etc/ssh/ssh_config
    debug1: /etc/ssh/ssh_config line 19: Applying options for *
    debug2: ssh_connect: needpriv 0
    debug1: Connecting to localhost [127.0.0.1] port 22.
    debug1: connect to address 127.0.0.1 port 22: Connection refused
    ssh: connect to host localhost port 22: Connection refused

  5. also i tried to change in th sshd_config from port 22 to port 2222 and i still get refused to port 2222..

  6. $ sudo netstat -pantu | grep LISTEN
    tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 5691/dnsmasq
    tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 9081/sshd
    tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1063/cupsd
    tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 1142/postgres
    tcp6 0 0 :::22 :::* LISTEN 9081/sshd
    tcp6 0 0 ::1:631 :::* LISTEN 1063/cupsd

Can anyone please help me?

Marco Leogrande
  • 8,050
  • 4
  • 30
  • 48
yeinhorn
  • 565
  • 1
  • 8
  • 12
  • you do not need to have `openssh-server`. It is a module for allowing remote access to your computer. So, the options that you have checked are most probably not for the problem you have. Can you please add the output of the command `git config --list` – Ankit Jun 29 '12 at 22:43

4 Answers4

2

After several attempts to generate keys deploy the heroku. I removed the toolbelt of my machine (Ubuntu) and installed manually again and added a new key .

user1658843
  • 61
  • 2
  • 7
0

Run ssh -v git@heroku.com to check which ip is working

107.21.95.3 is working for me create config file in ~/.ssh if you dont have vi ~/.ssh/config:

Host heroku.com
User yourusername
Hostname 107.21.95.3 
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
port 22
nickleefly
  • 3,733
  • 1
  • 29
  • 31
0

I had such problem after I had been doing backup over ssh.

Rebooting client machine helped.

Tebe
  • 3,176
  • 8
  • 40
  • 60
0

Sometimes it's help to reopen the terminal. On mac sierra and high sierra you should need a configuration file at ~./ssh/config Host * AddKeysToAgent yes UseKeychain yes IdentityFile ~/.ssh/id_rsa VerifyHostKeyDNS yes // after adding this line it start to work

Don't forget to reopen terminal and try again.

Eran Or
  • 1,252
  • 15
  • 22