SSH Connection closed by <ip>

The OpenShift forums have been retired.
You can still read and search them, but for help, please post a question on Stack Overflow.

Hi, I am using Ubuntu 12.10. Try to connect my app by SSH. But i got the SSH message "SSH Connection closed by ".

Does anyone know the problem. And I can't even push my code to the server.

=== ssh: Could not resolve hostname : Name or service not known === fatal: The remote end hung up unexpectedly

PS. I did the ssh key already follow step from the document.

Looks like a DNS issue. There was some DNS slowness last night, which would often cause "Could not resolve hostname " problem.

Try

$ nslookup <yourapp>-<yourdomain>.rhcloud.com
 
$ ping nslookup <yourapp>-<yourdomain>.rhcloud.com

If both of these work, then ssh should work too.

Hi,

nslookup result.

============ NSLOOKUP ================

Server: 127.0.1.1

Address: 127.0.1.1#53

Non-authoritative answer:

.rhcloud.com canonical name = ex-std-node10.prod.rhcloud.com.

ex-std-node10.prod.rhcloud.com canonical name = ec2-50-16-130-228.compute-1.amazonaws.com.

Name: ec2-50-16-130-228.compute-1.amazonaws.com

Address: 50.16.130.228

============ NSLOOKUP ================

SSH still not working for me.

Thank a lot for you reply.

@Mic, feels like the host resolution is failing from your machine.
Try with just the ip address instead of the host name and see if that works.

Meaning something like: ssh -i ~/.ssh/{libra_}id_rsa $guid@50.16.130.228
replace the identity file name based on what you are using (libra_id_rsa or id_rsa)
and $guid with your application's uuid.

If it does, then looks like DNS resolution is failing from your machine ...
possibly sorta setup issue?

HTH

Hi ramr,

It's work : )

Thank a lot.

i have the same problem can any one help me,thx a lot~ Problem 1:

C:\Users\luzt>ssh -v ssh://82be5487ecec4ea7b2f6249a6a190d8c@jz-iwork.rhcloud.com
 -p 443
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to jz-iwork.rhcloud.com [184.72.166.18] port 443.
debug1: Connection established.
debug1: identity file /.ssh/identity type -1
debug1: identity file /.ssh/id_rsa type -1
debug1: identity file /.ssh/id_dsa type -1
ssh_exchange_identification: Connection closed by remote host

Problem 2:

C:\Users\luzt>ssh 82be5487ecec4ea7b2f6249a6a190d8c@jz-iwork.rhcloud.com
ssh: connect to host jz-iwork.rhcloud.com port 22: Bad file number

@4snails, the first problem is irrelevant since the syntax used is incorrect. Should be:
$> ssh -v 82be5487ecec4ea7b2f6249a6a190d8c@jz-iwork.rhcloud.com

The second problem, more relevant one, appears you hit a blocked port. Not sure what the command is for windows, but you can validate by running:
$> nmap -sS github.com -p 22
//as per http://stackoverflow.com/questions/7144811/git-ssh-error-connect-to-host-bad-file-number

Please try from a server/network that doesn't block the ssh port (22). Wondering where you're trying to reach the gears from (e.g., country code?). See @Misc's note (https://www.openshift.com/forums/openshift/i-can-not-log-into-my-openshift-application-with-ssh#comment-26453), but there's no way for me to validate. I can ask around though.

HTHs;
~Nam