Ssh: connect to host.

I am using heroku 12.04 and trying to run

$ git push heroku master 

      

but I am getting the following error:

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

      

if i try

$ ssh git@github.com 

      

I am getting the same error

I've searched for other questions on this and haven't figured it out yet, but these are some of the things I checked:

  • I have openssh server installed

  • $ service ssh status
    ssh start/running, process 8819


  • $ service sshd start
    sshd: unrecognized service


  • $ 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


  • also i tried to change in sshd_config from port 22 to port 2222 and i am still denied on port 2222.

  • $ 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 help me?

0


source to share


3 answers


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



+2


source


Run ssh -v git@heroku.com

to check which ip is running

107.21.95.3

works for me create config file in ~/.ssh

if you don't havevi ~/.ssh/config:



Host heroku.com
User yourusername
Hostname 107.21.95.3 
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
port 22

      

0


source


I had this problem after doing an ssh backup.

Restarting the client machine helped.

0


source







All Articles