Web SSH Client using ssh2, socket.io, xterm.js, and express. webssh webssh2
Find a file
2021-05-20 16:37:12 -04:00
.devcontainer 0.4.0 Release (#246) 2021-05-19 10:22:29 -04:00
app bump ver 2021-05-20 16:35:47 -04:00
bin Missing require('fs') in server/app.js See issue [#135](../../issues/135) 2019-06-13 14:39:47 -04:00
Build/Release 0.2.8 ready for pr (#133) 2019-05-25 22:54:32 -04:00
screenshots demo screenshot 2018-02-10 15:52:19 -05:00
.csslintrc prefs for codeclimate 2017-09-29 17:04:22 -04:00
.dockerignore chore: add .dockerignore 2020-03-19 10:30:19 -04:00
.gitignore Update .gitignore 2019-05-16 11:52:38 -04:00
.travis.yml Merge branch 'master' into dev 2021-05-19 12:22:56 -04:00
BUILDING.md 0.4.0 Release (#246) 2021-05-19 10:22:29 -04:00
ChangeLog.md docs: update changelog 2021-05-20 16:35:58 -04:00
CODE_OF_CONDUCT.md Create CODE_OF_CONDUCT.md 2018-02-28 21:52:15 -05:00
CONFIGURATION.md docs: reorganize and update 2021-05-20 16:37:12 -04:00
CONTRIBUTING.md Create CONTRIBUTING.md 2018-02-28 21:58:59 -05:00
Dockerfile 0.4.0 Release (#246) 2021-05-19 10:22:29 -04:00
ISSUE_TEMPLATE.md Update ISSUE_TEMPLATE.md 2018-11-21 11:29:19 -05:00
LICENSE update license to MIT 2017-09-27 16:20:57 -04:00
Makefile Update CI tools (#248) 2021-05-19 12:13:37 -04:00
README.md docs: reorganize and update 2021-05-20 16:37:12 -04:00

WebSSH2

GitHub version Build Status

Buy Me A Coffee

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

A bare bones example of an HTML5 web-based terminal emulator and SSH client. We use SSH2 as a client on a host to proxy a Websocket / Socket.io connection to a SSH2 server.

WebSSH2 v0.2.0 demo

Requirements

Node v6.x or above. If using <v6.x you should be able to run by replacing the "read-config" package to @1 like this (after a clone):

npm install --save read-config@1

Just keep in mind that there is no intention to ensure compatability with Node < v6.x

Instructions

To install:

  1. Clone to a location somewhere and then cd app and npm install --production. If you want to develop and rebuild javascript and other files utilize npm install instead.

  2. If desired, edit app/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.

Customizing client files

See BUILDING.md for more details.

Docker Instructions

Copy app/config.json.template to app/config.json and modify the latter:

{
  // ...
  "listen": {
    "ip": "0.0.0.0",
    "port": 2222
  }
  // ...
}

Rebuild and run

docker build -t webssh2 .
docker run --name webssh2 -d -p 2222:2222 webssh2

Alternatively if you don't want to rebuild, mount the config at runtime:

docker run --name webssh2 -d -p 2222:2222 -v `pwd`/app/config.json:/usr/src/config.json webssh2

Configuration

see CONFIGURATION

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&headerBackground=red

CONTRIBUTING

As of 0.4.0, we're trying our best to conform to the Airbnb Javascript Style Guide. I'm hoping this will make contributions easier and keep the code readable. I love shortcuts more than anyone but I've found when making changes to code I've not looked at in a while, it can take me a few momements to deconstruct what was being done due to readbility issues. While I don't agree with every decision in the style guide (semi-colons, yuk), it is a good base to keep the code consistent.

If you've not used it before, I recommend installing the vscode extensions for that and Prettier and getting familiar. The autocorrections are great (especially if you hate dealing with semi-colons...)

All contributions are welcome, all may not make it into a release... To increase the chances of your contribution making it into a release, try your best to conform to the style guides and targets of the project.

Tips

  • You can enable extended debug messages in the browser Java console using:
    • localStorage.debug = '*'; - Debug Everything (a lot of messages)
    • localStorage.debug = 'WebSSH2'; - Debug potentially interesting WebSSH2 related messages (replaying credentials, resizing data, other control messages)
  • If you want to add custom JavaScript to the browser client you can either modify ./src/client.html and add a <script> element, modify ./src/index.js directly, or check out webpack.*.js and add your custom javascript file to a task there (best option).