Write a ssh client using TCP sockets (Port ssh client?)

RESOLVED WONTFIX

Status

--
enhancement
RESOLVED WONTFIX
5 years ago
2 years ago

People

(Reporter: gkw, Unassigned)

Tracking

({feature})

unspecified
All
Gonk (Firefox OS)
feature
Dependency tree / graph

Firefox Tracking Flags

(b2g18?)

Details

(Reporter)

Description

5 years ago
I was chatting with Fabrice in-person, and it would be nice to have a bash shell (or shell of some sort) present in Firefox OS, by ssh'ing into localhost.

This will be a nice prerequisite to having the entire toolchain (gcc/clang) on it, then compiling Firefox OS on Firefox OS, and debugging Firefox OS on Firefox OS. Especially since we might have Firefox OS on laptops:

https://blog.mozilla.org/ligong/2013/06/03/foxconn-joins-the-firefox-os-eco-system/


We could also ssh into remote hosts, for that matter. There is a FireSSH (Firefox add-on) at:

https://addons.mozilla.org/en-us/firefox/addon/firessh/

that might be useful.

Comment 1

5 years ago
If there's some way I can help, let me know ^_^
Duplicate of this bug: 948482

Comment 3

5 years ago
We (with some others peoples) have made a pad to shape that :) https://etherpad.mozilla.org/UiQA0T4Xer
(Reporter)

Updated

5 years ago
Blocks: 950779
Keywords: feature

Comment 4

4 years ago
My solution using 'Anyterm': https://support.mozilla.org/de/questions/1006954

Comment 5

4 years ago
Temporary solution using webshell, which offers onscreen keyboard and functions:
http://piie.net/index.php?section=firefoxos

Comment 6

4 years ago
I would like to start working on this. Can someone please suggest the next steps?
I came across this @https://github.com/Mozilla-Student-Projects/Projects-Tracker/issues. I have reached out to Yoric and Antoine also in this regard..

Comment 7

4 years ago
I'm still available to help out - I can't work on it fulltime as I'm occupied with my main job but I will gladly assist in anyone who wants to take point and lead the effort.

Comment 8

4 years ago
I've got a SSH Client working; It needs some code cleanup before it's ready, though.
@David, is up on github?  I'd be happy to help.

Comment 10

4 years ago
https://github.com/chuckwagoncomputing/fxos-firemote

Things that need to be done:
(1) The UI for saved servers and settings was kind of thrown together; it might be worthwhile to switch to a card-based design.
(2) Someone with more IndexedDB experience than I ought to look over the DB code and ensure that it is AOK.
(3) I cut public key auth out of paramikojs (https://github.com/chuckwagoncomputing/paramikojs); and copy, paste, and keyboard shortcuts out of cli.js. They are completely functional, but ought to be checked over for unused code.
(4) Comments.

Updated

4 years ago
Depends on: 1117182

Comment 11

3 years ago
I bring you good news that will cause great joy for (hopefully) all the fxos-ers in need of an SSH-client: After installing FXOS 2.6 I found it working again \o/

Device: Flame
Platform Version: 45.0a1
Build Identifier: 20151105150203
Tested with App: https://github.com/chuckwagoncomputing/fxos-firemote

Can anyone confirm?

If this is a stable status I'll get rid of Android at last.
Thanks a lot! 

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

Comment 12

3 years ago
@David thanks for taking this on - I'm glad you took the time to make something useful for FxOS

> (3) I cut public key auth out of paramikojs (https://github.com/chuckwagoncomputing/paramikojs); and copy, paste, and keyboard shortcuts out of cli.js. They are completely functional, but ought to be checked over for unused code.

Couple items I noticed off the bat:
- afaict, you don't keep a list of known hosts anymore and just accept the server without giving the user a view of the hash and the option to reject the server when logging onto it for the first time...
- knownhosts - "Unknown Keys" is necessary so that you don't clobber entries you don't know how to parse
Public Key support, see also https://github.com/paramiko/paramiko/issues/435
- Why no RSA Key support?
- You can remove the SFTP support I suppose but I imagine somebody will ask for support on FxOS soon enough.  Goes along with my next comment.

In general, it's a little tough to review your code changes since the changes weren't made to the upstream paramikojs library.  Was there a reason that your changes couldn't be integrated with the existing library, to improve it and so that your code stays in sync as security issues and bugs arise?  Much like the original Python Paramiko library it's meant to be versatile and useful in a variety of situations - I would have rather that the base library stay centralized vs. forking.  Some clarity on your decision there would be helpful. Were there changes that were truly hard breaking FxOS?

Briefly on the code surrounding ParamikoJS:
You're using code like document.getElementById('servers').innerHTML which is a poor idea all around.  The major concern there is that somebody could inject something malicious.  Afaict, it currently is perhaps 'fine' - but that opens up a vector in the future if somebody accidentally adds other unknown/unsafe content.

Also, it's impossible to review your code outside of ParamikoJS since it was mass added in a commit called 'add code': https://github.com/chuckwagoncomputing/fxos-firemote/commit/8545195825e534693dedaf29fe77842da3ff8082
I cannot therefore look to see what the differences are to help you see if there are any problems that might be there.  So for example, if I wanted to see if there was anything in cli.js that you added (that might also be useful upstream) or that might be problematic it would be a very manual process right now. 
One idea might be to start with a fork and add commits from there. 

Hope that helps.

Comment 13

3 years ago
Thanks Mime. This is the kind of critique I need.
1. I plan on adding known hosts back in.
2. I'm working on Public Key support.
3. I may/should add SFTP support back in.

My reason for cutting away non-basic features was to make it simpler to get a working, basic SSH app. In hindsight it may have not been such a good idea.

What is a good clean method of manipulating the markup from JS?

Regarding "add code.": I guess I haven't learned my lesson yet.

Thanks again for the help.
There appears to be another bug with Firemote that Nino Vranešič found while testing so ETA for publishing is probably two weeks at least, depending on how much spare time I can find.

Comment 14

3 years ago
Yeah, no problem.  Sorry for my delay actually in giving feedback in the first place. :-/

> What is a good clean method of manipulating the markup from JS?

Well, it's slightly more cumbersome but you can generate the html by doing 
document.createElement('div') and setting the `textContent` property when appropriate.  You can also get fancier using new Web Components <template> : https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template

> Regarding "add code.": I guess I haven't learned my lesson yet.

I'm still learning as well fwiw!  No worries, mate.

> There appears to be another bug with Firemote that Nino Vranešič
> found while testing so ETA for publishing is probably two weeks at
> least, depending on how much spare time I can find.

Ok, gotcha.
(Reporter)

Updated

2 years ago
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.