How to Set Up SSHy: A HTML5 Based SSH Client with E2E Encryption

Aug 15, 2024 | Programming

In this guide, we will explore how to set up and run SSHy, a HTML5 SSHv2 web client that is both fast and responsive, featuring end-to-end encryption. Whether you are an experienced developer or a newbie, this user-friendly article will help you get started and troubleshoot common issues you might encounter along the way.

About SSHy

SSHy is designed to ensure secure communication via SSH with E2E encryption courtesy of SJCL. It implements a minimal subset of the SSHv2 protocol to control a pseudo-terminal. The front-end interface is enriched by xterm.js. You can preview SSHy in action at linuxzoo.net or check a non-functional preview at stuicey.github.io/SSHy.

Features

  • 8 Preset color schemes
  • Xresources upload and import
  • UTF-8 Character support
  • Automatic local echo detection
  • Customizable terminal font size
  • Copy and Paste support for Chrome and Firefox
  • Network Traffic Monitor

Installation

Let’s dive into the setup process. To begin, you can either copy or clone the SSHy repository into a directory that is being actively served by a web server. Then, navigate to index.html.

There are two versions available:

  • index.html: The main page with a modal login container and modifiable destination IP.
  • wrapper.html: A minimal wrapper meant for CGI builds with an interactive terminal login and a fixed destination IP. By default, SSH-RSA is disabled; if you want it enabled, uncomment the line transport.settings.rsaCheckEnabled = false;.

Required Files

Ensure you have the following files in your directory:

  • css
  • fonts
  • js
  • index.html OR wrapper.html

Proxy Setup for Best Performance

For optimal performance, host a websocket proxy close to the traffic origin or destination by modifying the wsproxyURL in either index.html or wrapper.html to point to your personal websocket proxy.

This project uses wsProxy as a submodule, allowing IP multiplexing. You can initiate the submodule using:

git submodule update --init --recursive

Install the wsproxy package by running:

npm i -g wsproxy

Other websocket proxies, like Websockify, should be compatible with wrapper.html.

Building SSHy

This project utilizes the Google Closure Compiler to minify and compile the JavaScript for both versions, index.html and wrapper.html. You may compile them manually or through Atom build.

To compile, use the following commands:

java -jar closure-compiler.jar --js_output_file=js/combinedLibs.comb.js js/defines.js js/src/*.js js/*.js !**/*.comb.js !**/Client.js
java -jar closure-compiler.jar --js_output_file=js/combinedJS.comb.js js/defines.js js/src/*.js js/*.js !**/*.comb.js

Compatibility

SSHy ensures compatibility with the majority of SSHv2 servers. It can connect to any standardly configured SSHv2 server with these algorithms enabled:

  • diffie-hellman-group-exchange
  • diffie-hellman-group14
  • diffie-hellman-group1
  • ssh-rsa
  • aes128-ctr
  • hmac

Both SHA1 and SHA256 are supported for diffie-hellman and HMAC algorithms.

Troubleshooting

If you encounter issues while setting up or running SSHy, consider the following troubleshooting tips:

  • Check your web server configuration to ensure it is properly serving the necessary files.
  • Verify that your websocket proxy is correctly set up; you may need to adjust the wsproxyURL accordingly.
  • If you experience connectivity issues, make sure the destination IP is accurately specified in your configurations.
  • Review the console logs in your browser’s developer tools for any error messages that could provide additional context.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

Setting up SSHy is a straightforward process that can enhance your SSH experience with its modern HTML5 interface and encryption features. Whether you’re looking to run a server or access remote machines securely, SSHy can meet your needs.

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox