chuckwagoncomputing / fxos-firemote

A SSH and Telnet Client for Firefox OS.
Mozilla Public License 2.0
16 stars 3 forks source link

Connectivity trouble : Did not receive identification string from ... #5

Closed fabbox closed 8 years ago

fabbox commented 9 years ago

I got some trouble to connect to computer. Is there any assumption on the ssh server configuration (or shell user ?).

When I try to connect I get the openssh version on firemote and below, there still the "press + to begin" but nothing else. Any idea what's wrongs here ?

Thanks in advance

chuckwagoncomputing commented 9 years ago

I corrected a problem in paramikojs. Please try it now.

fabbox commented 9 years ago

Hello, thank you for your answer.

I remove the paramikojs the paramikosjs folder and clone the new one (to be on the last commit) but nothing changed here. The server log tells Did not receive identification string from my ip when I close the app. netstat command tells sshd [accepted] on the server.

On the phone, I got : Connected (version 2.0, client OpenSSH_6.0p1NaNDebian-4) Touch + to begin.

The console log from WebIDE just says : 192.168.1.60:22 (the server ip)

My device is a ZTE Open C with a home build B2G version 2.2.

EDIT : I also tried with "simulated version" with WebIDE. The app works perfectly on fxos 1.3 and 2.0 but doesn't work with fxos 2.1 and 2.2. So it may be a change of API name or a new security reason.

chuckwagoncomputing commented 9 years ago

I'm using a device with 2.0, so I didn't notice. I'm looking in to it.

chuckwagoncomputing commented 9 years ago

This is driving me crazy. The same text is being sent from 2.1 as is being send from 2.0, but in 2.1 the server's supported algo/crypto information is never received.

I inserted some console.log statements in the ondata handler and in the write function to demonstrate. Here are logs.

2.0:

"192.168.1.3:22"                                                                                                      ssh2.js:37
"R: SSH-2.0-OpenSSH_6.0p1 Debian-4
"                                                                                                                     ssh2.js:43
"W: SSH-2.0-FireFTP
"                                                                                                                     ssh2.js:68
"R: (server's algo/crpto stuff with special charactes that didn't paste correctly)
"                                                                                                                     ssh2.js:43  
"W: (client's algo/crypto stuff)
"                                                                                                                     ssh2.js:68

...and so on and so forth with data as it should be.

2.1:

"192.168.1.3:22"                                                                                                      ssh2.js:37
"R: SSH-2.0-OpenSSH_6.0p1 Debian-4
"                                                                                                                     ssh2.js:43
"W: SSH-2.0-FireFTP_
"                                                                                                                     ssh2.js:68

...and that's it. No more data is received or sent. I have verified that it's not a timing problem. 2.1 is repeatably within 1 millisecond of 2.0.

fabbox commented 9 years ago

Thanks a lot for your answer !

I started to study the code but I'm afraid that I'll will not be a great help ( I need some time to understand the whole program). I can reproduce what you showed.

As far as I understand the code (until now, there is a far from zero possibility I miss the point), the program open the connection, received data (ondata) once then do nothing (on fxos 2.1+). I did not find yet if (where) the data is sent from the phone just after the ondata event and before the other one on fxos 2.0.

Before becoming "too crazy", don't forget that it may be bug from B2G/gaïa.

fabbox commented 9 years ago

Hi, the more I explore, the less I understand why this bug happens. Do you think we should provide a minimum example to submit to the B2G/gaiai mailing list to see if someone have an idea if something change on their side ?

chuckwagoncomputing commented 9 years ago

It's breaking on the null character. I had this problem before with socket binary type set to ordinary javascript string. Setting binary type fixed it, but apparently only on versions before 2.1.

https://bugzilla.mozilla.org/show_bug.cgi?id=1117182

chuckwagoncomputing commented 8 years ago

This bug has (finally!) been fixed. https://bugzilla.mozilla.org/show_bug.cgi?id=1117182#c7 And there was much rejoicing. Closes #6.