ssh: connect to host heroku port 22: Connection refused - ruby-on-rails

I'm trying to push a Rails application up to heroku and it continuously gives me this error:
ssh: connect to host 107.21.95.3 port 22: Connection refused
fatal: Could not read from remote repository.
This worked earlier in the week at both a public wifi location and a private wifi location. I have looked at ssh-connect-to-host-heroku and git-push-heroku-master. Through these two answers I uninstalled and reinstalled the Heroku Toolbelt, added a new SSH key to heroku, and created a new application in heroku to push to.
When I use ssh -T heroku.com or ssh -vT heroku.comI respectively get:
ssh: connect to host 107.21.95.3 port 22: Connection refused
and
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/christinaleuci/.ssh/config
debug1: /Users/christinaleuci/.ssh/config line 2: Applying options for heroku.com
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to 107.21.95.3 [107.21.95.3] port 22.
debug1: connect to address 107.21.95.3 port 22: Connection refused
ssh: connect to host 107.21.95.3 port 22: Connection refused

I have had a lot of problems with keys and Heroku. I started using Heroku Accounts and that has made it a lot easier. Make sure your public key is listed within your account under SSH keys here.
BTW, ssh -v git#heroku.com fails for me when using Heroku Accounts but I am able to use my accounts without issue.

I had the same error and found out at that SSH was blocked at my office. If you can't SSH to anywhere that's might be your problem, but if you can SSH to somewhere that's not Heroku I'm not sure.

Related

Workbench fails to connect when using SSH tunnel to hosted DB

experiencing connecting workbench through SSH tunnel to connect to a hosted mysql DB. I'm using port 3309 as I have a local wamp server running mysql on 33066
My first time trying to connect via SSH so any help would be appreciated...
If I try through workbench using standard TCP/IP over SSH I get the below error message
Failed to Connect to MySQL at dbxxx.db.1and1.com:3306 through SSH tunnel at user#homexxxxxxx.1and1-data.host:22 with user dboxxxxxx
[Content]
Lost connection to MySQL server at 'reading initial communication packet', system error: 0
If I use an SSH connection via putty with port forwarding I get the following error
Putty port forward config: source = 3309 destination = dbxxx.db.1and1.com:3306
Error I get back when connecting through workbench is:
Failed to Connect to MySQL at 127.0.0.1:3309 with user dbuser
[Content]
Lost connection to MySQL server at 'reading initial communication packet', system error: 0

ios push notification connection refused

I have a AWS server which runs centos 7 operating system. The server has CSF installed and is a production server. My site is running fine on it (PHP). Now when I am trying to send a notification to ios I am getting connection refused error. Then when I did telnet I got the following response:
telnet gateway.sandbox.push.apple.com 2195Trying 17.188.166.22...
telnet: connect to address 17.188.166.22: Connection refused
Trying 17.188.166.23...
telnet: connect to address 17.188.166.23: Connection refused ...
In outgoing ports aws server security allows all traffic.Why is this happening ? Do I need to open inbound ports for 2195? I read in this site that its not required.

Failed to connect to bitbucket.org port 443: Network is unreachable

Iam getting the following issue while trying to clone the repository.
fatal: unable to access 'https://Tejaswikatha#bitbucket.org/activecubs_angularjs/activecubs-admin-angularjs.git/': Failed to connect to bitbucket.org port 443: Network is unreachable
For UBUNTU:
Open /etc/hosts file
Add 104.192.143.3 bitbucket.org as a first line and save file
Now cloning will work.
This may be caused by known issues trying to git push, pull, clone over IPv6.
You can force IPv4 by adding the following line to your hosts file (/etc/hosts on Linux, c:\windows\System32\drivers\etc\hosts on Windows):
104.192.143.1 bitbucket.org
In you have a newer git client (>2.8), you can also force IPv4 via the -4 or --ipv4 switch.

Unable to push 'heroku master'

When I tried to run 'git push heroku master', I got the error
ssh: connect to host heroku.com port 22: Connection timed out
fatal: The remote end hung up unexpectedly
I run the command 'ssh -vvv git#heroku.com' to know what is happening, the result is
OpenSSH_5.9p1 Debian-5ubuntu1.3, 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 heroku.com [50.19.85.154] port 22.
debug1: connect to address 50.19.85.154 port 22: No route to host
debug1: Connecting to heroku.com [50.19.85.132] port 22.
debug1: connect to address 50.19.85.132 port 22: No route to host
debug1: Connecting to heroku.com [50.19.85.156] port 22.
debug1: connect to address 50.19.85.156 port 22: No route to host
ssh: connect to host heroku.com port 22: No route to host
I'm a newbie to deployment and ssh. Please help.

ssh connection to git failing

I am opening some question I somewhat asked before but now the problem seems to be pretty linked to ssh.
I have installed Gitlab in /home/myuser/gitlab.
I created a rep test
Following instructions, I added a remote git#localhost:root/testing.git (Gitlab's server runs on port 3000)
Now, when I try to push, I get this error message:
$ git push -u origin master
ssh: Could not resolve hostname mylocalhost: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Now, I found that there was a problem with my ssh connect. Here's my /home/myhome/.ssh/config file
Host mylocalhost
Hostname localhost
PORT 3000
User git
IdentityFile /home/myuser/.ssh/id_rsa.pub
When I run ssh mylocalhost I get this message
ssh_exchange_identification: Connection closed by remote host
On verbose mode, it seems that the connection is established on the right port but the porcess fails here debug1: ssh_exchange_identification: HTTP/1.1 400 Bad Request.
I tried to update my /System/Library/LaunchDaemons/ssh.plist (I am using OSX) to forward port listening to 3000 but then the Gitlab Webrick Rails server won't run anymore. L tried to change git remote set-url origin mylocalhost:testing.git
Gitlab's HTTP interface is probably running on port 3000, but SSH isn't running there to push the repository to.
The message of ssh: connect to host localhost port 22: Connection refused means that the SSH client was unable to connect to the SSH server at localhost on port 22. I'd ensure you've installed gitlab correctly and Gitlab is running correctly. Also ensuring the ssh server is running and able to accept connections on port 22.
You cannot hope to use the port 3000 if you are using a fully specified url
git#localhost:root/testing.git
As I have explained to you before:
The idea of the ssh config file is to define an entry "foobar" which will set the right server name (Hostname), ssh private key (IdentityFile), and user under which the ssh session is opened.
That would allow to do 'ssh foobar' (without having to put git#xxx, and with non-standard public/private keys files).
You can define as many entry as you want, allowing you to use different user and keys.
So you cannot define origin with git#xxx. You must type:
git remote add origin mylocalhost:testing.git
Or, if origin is already defined, and you need to change its url:
git remote set-url origin mylocalhost:testing.git
(no 'root/' you don't specify any path in front of a gitlab repo: gitlab will deduce the full path of the repo)
But you need to be sure your sshd starts on port 3000, and that gitlab.yml contains that port number.
ssh: Could not resolve hostname mylocalhost: nodename nor servname provided, or not known
That means ssh cannot find ~/.ssh/config, with a mylocalhost entry in it.
Make sure that file exist.
Your previous question put in ~/.git/config, which has nothing to do with ssh.
At last, I figured out what was the problem. I had to set properly the ~/.ssh/config file
Host mylocalhost
Hostname localhost
//I deleted a line specifying the PORT to 3000
User git
IdentityFile /home/myuser/.ssh/id_rsa //It was previously set to /home/myuser/.ssh/id_rsa.pub
Then I reinstalled a key but I still got some problem. Finally, setting the perm of the file /home/myuser/.ssh/id_rsa to 644 and it worked just fine. For information, I found searching in the web that some settings could work with a 700 or a 600 chmod perm, but for me 644 did the trick

Resources