Web SSH Client using ssh2, socket.io, xterm.js, and express. webssh webssh2
Find a file
2017-05-26 17:30:41 -04:00
public error handling fixups 2017-05-20 17:26:18 -04:00
socket refactoring 2017-05-26 11:25:44 -04:00
util refactoring 2017-05-26 11:25:44 -04:00
.bithoundrc formatting 2017-05-19 20:58:26 -04:00
.gitignore adding some more files to ignore… 2017-02-01 15:56:41 -05:00
.snyk updating sync profile 2017-05-19 19:55:39 -04:00
.travis.yml updated .travis.yml" 2017-05-18 16:07:53 -04:00
ChangeLog.md refactoring 2017-05-26 11:25:44 -04:00
config.json updated documentation and version 2017-05-26 17:30:41 -04:00
index.js refactoring 2017-05-26 11:25:44 -04:00
LICENSE Create LICENSE 2016-05-18 13:08:45 -04:00
package.json updated documentation and version 2017-05-26 17:30:41 -04:00
README.md updated documentation and version 2017-05-26 17:30:41 -04:00

WebSSH2 GitHub version Build Status Known Vulnerabilities bitHound Overall Score bitHound Dependencies NSP Status

Web SSH Client using ssh2, socket.io, xterm.js, and express

Bare bones example of using SSH2 as a client on a host to proxy a Websocket / Socket.io connection to a SSH2 server.

Screenshot 2017-03-23 18.13.59

Instructions

To install:

  1. Clone to a location somewhere and npm install

  2. If desired, edit config.json to change the listener to your liking. There are also some default options which may be definied for a few of the variables.

  3. Run npm start

  4. Fire up a browser, navigate to IP/port of your choice and specify a host (https isn't used here because it's assumed it will be off-loaded to some sort of proxy):

http://localhost:2222/ssh/host/127.0.0.1

You will be prompted for credentials to use on the SSH server via HTTP Basic authentcaiton. This is to permit usage with some SSO systems that can replay credentials over HTTP basic.

Options (GET request vars)

port= - port of SSH server (defaults to 22)

header= - optional header to display on page

headerBackground= - optional background color of header to display on page

Config File Options

config.json contains several options which may be specified to customize to your needs, vs editing the javascript direclty. This is JSON format so mind your spacing, brackets, etc...

  • listen.ip - string - IP address node should listen on for client connections, defaults to 127.0.0.1

  • listen.port - integer - Port node should listen on for client connections, defaults to 2222

  • user.name - string - Specify user name to authenticate with. In normal cases this should be left to the default null setting.

  • user.password - string - Specify password to authenticate with. In normal cases this should be left to the default null setting.

  • ssh.host - string - Specify host to connect to. May be either hostname or IP address. Defaults to null.

  • ssh.port - integer - Specify SSH port to connect to, defaults to 22

  • ssh.term - string - Specify terminal emulation to use, defaults to xterm-color

  • header.text - string - Specify header text, defaults to My Header but may also be set to null.

  • header.background - string - Header background, defaults to green.

  • session.name - string - Name of session ID cookie. it's not a horrible idea to make this something unique.

  • session.secret - string - Secret key for cookie encryption. You should change this in production.

  • options.challengeButton - boolean - Challenge button. This option, which is still under development, allows the user to resend the password to the server (in cases of step-up authentication for things like sudo or a router enable command.

  • algorithms - object - This option allows you to explicitly override the default transport layer algorithms used for the connection. Each value must be an array of valid algorithms for that category. The order of the algorithms in the arrays are important, with the most favorable being first. Valid keys:

    • kex - array - Key exchange algorithms.

      • Default values:

        1. ecdh-sha2-nistp256 (node v0.11.14 or newer)
        2. ecdh-sha2-nistp384 (node v0.11.14 or newer)
        3. ecdh-sha2-nistp521 (node v0.11.14 or newer)
        4. diffie-hellman-group-exchange-sha256 (node v0.11.12 or newer)
        5. diffie-hellman-group14-sha1
      • Supported values:

        • ecdh-sha2-nistp256 (node v0.11.14 or newer)
        • ecdh-sha2-nistp384 (node v0.11.14 or newer)
        • ecdh-sha2-nistp521 (node v0.11.14 or newer)
        • diffie-hellman-group-exchange-sha256 (node v0.11.12 or newer)
        • diffie-hellman-group14-sha1
        • diffie-hellman-group-exchange-sha1 (node v0.11.12 or newer)
        • diffie-hellman-group1-sha1
    • cipher - array - Ciphers.

    • hmac - array - (H)MAC algorithms.

      • Default values:

        1. hmac-sha2-256
        2. hmac-sha2-512
        3. hmac-sha1
      • Supported values:

        • hmac-sha2-256
        • hmac-sha2-512
        • hmac-sha1
        • hmac-md5
        • hmac-sha2-256-96
        • hmac-sha2-512-96
        • hmac-ripemd160
        • hmac-sha1-96
        • hmac-md5-96
    • compress - array - Compression algorithms.

Experimental client-side logging

Clicking Start logging on the status bar will log all data to the client. A Download log option will appear after starting the logging. You may download at any time to the client. You may stop logging at any time my pressing the Logging - STOP LOG. Note that clicking the Start logging option again will cause the current log to be overwritten, so be sure to download first.

Example:

http://localhost:2222/ssh/host/192.168.1.1?port=2244&header=My%20Header&color=red