Embed SSH Terminal in Webpage (for users with the extension)

532 views
Skip to first unread message

s...@sarahalstonphotography.com

unread,
Sep 14, 2015, 7:13:50 PM9/14/15
to chromium-hterm
Hey,

I'm working on a tool to make my team's sprint demos a little easier to do.  We have a tool that let's us easily demo web-based content fairly easily, but for SSH we have to go and swap cables and everything.  What I'd like to do is embed a tag into the webpage, something like "<ssh-term/>" and use an extension to embed the NASSH page.  This would allow us to demo pretty quickly without swapping apps or cables.

I've made a basic attempt at this, but it seems like once the iframe is in place it cannot see the plugin.  I managed to tweak some files (and force it to consider itself to be non-V2 of the app) and now I get a "connection refused" error, with the plugin exiting with Error 255.

Anybody build something like this before?

Mike Frysinger

unread,
Sep 14, 2015, 7:53:36 PM9/14/15
to s...@sarahalstonphotography.com, chromium-hterm

chromium itself doesn't allow web pages or extensions to use the socket api to access arbitrary addresses/ports due to security concerns.  I'd assume that NaCl would be similarly sandboxed which means it's not possible to embed an ssh client in a page.  you probably want to check that this is fundamentally feasible first ... stack overflow might be your best bet.

not that I understand your "swap cables" statement since you can launch SecureShell via a <a> tag and run it with the same network setup.
-mike

--
You received this message because you are subscribed to the Google Groups "chromium-hterm" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-hterm/8292a3fe-fd3a-4716-a812-83d7564beff7%40chromium.org.

Robert Ginda

unread,
Sep 15, 2015, 1:28:45 PM9/15/15
to s...@sarahalstonphotography.com, chromium-hterm
The nacl plugin that comes with secure shell uses a Socket API that has been whitelisted to just Secure Shell and maybe one or two other apps that have been around about as long.  The new socket API is open to more apps, but requires pnacl rather than nacl.  In either case, I don't think you'll get socket access from a regular web page.

Secure Shell supports XMLHttpRequest based connections to a relay server, which turns websocket traffic into plain-old TCP.  There's an open-source implementation of the relay here https://github.com/zyclonite/nassh-relay.  This would let you embed Secure Shell in a regular web page without needing any additional permissions.

I also don't understand the cable-swapping commend.  Like Mike said, you can launch Secure Shell from an anchor tag, and can even point it to a particular saved configuration or username/hostname pair.


Rob.

--

Sam Alston

unread,
Sep 15, 2015, 1:42:27 PM9/15/15
to Robert Ginda, chromium-hterm
We have a screensharing and control component built into the tool.  It allows the developer to sit at their computer and control the mouse and keyboard of the "demo" box.  What I wanted to do was to ssh from the demo box so that we didn't have to share the devs box (via swapping the cable from the demo box to the Dev box.)

Thanks,

Sam

Reply all
Reply to author
Forward
0 new messages