Is it possible to connect to SSH using JavaScript?

后端 未结 4 937
自闭症患者
自闭症患者 2020-12-28 15:15

I know there is an implementation of VNC using WebSockets (http://novnc.com) but that still requires a server. I am looking to create a simple client-side JavaScript only (n

相关标签:
4条回答
  • 2020-12-28 15:48

    For those still searching, paramikojs could be the answer.

    I'm currently having a similar issue:I need a SSH JS client-side implementation, and I need it to be BSD licensed. Alas paramikojs seems to be GPL licensed.

    0 讨论(0)
  • 2020-12-28 15:49

    It's definitely possible using a Linux emulator with full network support like the great OpenRISC emulator jor1k.

    Note that I've created browser-tools.net, a collection of in-browser tools from number of different projects.

    0 讨论(0)
  • 2020-12-28 15:58

    You can take a look at serfish. It's a solution to access a SSH server. But if you're hosting your web application on the same server as your ssh, there are other solutions such as shell in a box.

    0 讨论(0)
  • 2020-12-28 16:07

    Sorry, given your constraints (client-side Javascript only), there is no way to connect to a plain old SSH server.

    WebSockets is not plain TCP. It's a framed protocol with a HTTP-like handshake between the client and server that includes origin policy.

    Flash can make plain TCP connections, but it also has origin policy enforcement. The way it does this is by making a connection to the same server on port 843 and asking for a special XML file that contains the origin policy. If you are willing to relax your constraints slightly such that you are willing to run a generic WebSockets to TCP proxy either on a server (any server) or on the client then you can do what you are wanting to do. noVNC includes a C and python WebSockets to TCP proxy: http://github.com/kanaka/noVNC/tree/master/utils/.

    Other info you might find useful:

    • Current WebSocket draft: http://tools.ietf.org/html/draft-hixie-thewebsocketprotocol-76

    • Simple (insecure) way of running a flash policy server (Linux/UNIX with socat) is described here: http://github.com/kanaka/noVNC/blob/master/docs/flash_policy.txt

    • More info about the flash policy file: http://code.google.com/p/doctype/wiki/ArticleFlashSecurity

    0 讨论(0)
提交回复
热议问题