While setting up my NAS, one thing which I always wanted was to able to connect my NAS machine using SSH. The idea of having to download and configure various applications on different devices seemed cumbersome. I needed a solution that allowed me to connect to SSH effortlessly, from any location, using just a web browser. That’s when I discovered Wetty.

WeTTy (Web + TTy) is “an alternative to ajaxterm and anyterm but much better than them because WeTTy uses xterm.js which is a full fledged implementation of terminal emulation written entirely in JavaScript. WeTTy uses websockets rather then Ajax and hence better response time.”

Installation

Installing Wetty via Docker is straightforward and efficient. Here’s a step-by-step guide:

  • Ensure Docker is Installed: Before diving into Wetty, make sure you have Docker installed on your system. If not, you can download it from Docker’s official website.

  • Pull the Wetty Docker Image: Open your terminal and run the following command to pull the Wetty image from Docker Hub:

docker pull wettyoss/wetty
  • Run the Wetty Container: After pulling the image, you can run Wetty with a simple command:
docker run --rm -p 3000:3000 wettyoss/wetty --ssh-host=<YOUR-IP>

This command will start Wetty on port 3000. You can change the port as needed.
“ssh-host” will be the server to which you want to connect

  • Access Wetty: Open your web browser and navigate to http://:3000. You’ll be greeted with Wetty’s web-based SSH terminal. Simply enter your credentials, and you’re ready to go!

Basic Authentication with Caddy

To keep bots out and add an extra layer of security, we can set up basic authentication using Caddy. Here’s how you can do it:

  • Create a Password File: First, you need to create a password file with bcrypt hashing. You can use htpasswd to generate the file. For example:
htpasswd -Bc /shared/wetty-htpasswd username
  • Configure Caddyfile: Next, configure your Caddyfile to use this password file for basic authentication. Here’s an example configuration:
yourdomain.com {
    basicauth /* {
        username hashed_password
    }
    reverse_proxy localhost:3000
}

Replace username with your actual username and hashed_password with the hashed password from your password file.

  • Run Caddy: Finally, run Caddy with your Caddyfile configuration:
caddy run --config /path/to/Caddyfile

This setup will enable basic authentication for your Wetty access, ensuring that only authorized users can connect to your SSH terminal.

Conclusion

One of the standout features of Wetty is the stability of the connection. Regardless of where I accessed my NAS from, the connection remained robust and reliable, ensuring a seamless experience every time. Overall, using Wetty has been an amazing experience, combining ease of use with impressive performance.

With Wetty and Caddy working together, managing your NAS becomes a breeze. So, if you’re looking for a seamless and secure SSH access solution, give Wetty a try – you won’t be disappointed!