How to Access Linux Server Terminal in Web Browser Using ‘Wetty (Web + tty)’ Tool

Page 1 of 212

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Gabriel Cánepa

Gabriel Cánepa is a GNU/Linux sysadmin and web developer from Villa Mercedes, San Luis, Argentina. He works for a worldwide leading consumer product company and takes great pleasure in using FOSS tools to increase productivity in all areas of his daily work.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

12 Responses

  1. yashar esmaildokht says:

    shellinabox is like a wetty for connect ssh in web browser.

  2. Alan says:

    Having issues getting this working on a Linux Mint distro (17.3)

    I install dependencies, type “node app.js -p 8080” but I get this:
    —————————————————————————————————-

    module.js:338
    throw err;
    ^
    Error: Cannot find module ‘bytes’
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object. (/home/alan/wetty/node_modules/express/node_modules/connect/lib/utils.js:394:22)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

    —————————————————————————————————————————————-
    Not sure where to go from there. I’m an amateur when it comes to Linux, so I don’t know how to resolve this.

    • @Alan,
      If you followed the installation instructions at the top of this post, you must have installed npm. You can verify this by running
      dpkg -l | grep npm
      or
      which npm
      If npm is installed (as it should), the first command should return the actual package name, whereas the output of the second command will show the path to the executable file. Otherwise, install npm first following the instructions given here.
      Next, install the bytes module:
      sudo npm install bytes
      Then try again and let us know how it went.

      • Alan says:

        OK, after I enter “node app.js -p 8080” I’m getting this:

        ————————————————————————————————————–
        module.js:338
        throw err;
        ^
        Error: Cannot find module ‘serve-static’
        at Function.Module._resolveFilename (module.js:336:15)
        at Function.Module._load (module.js:278:25)
        at Module.require (module.js:365:17)
        at require (module.js:384:17)
        at Object. (/home/alan/wetty/node_modules/express/node_modules/connect/lib/middleware/static.js:19:18)
        at Module._compile (module.js:460:26)
        at Object.Module._extensions..js (module.js:478:10)
        at Module.load (module.js:355:32)
        at Function.Module._load (module.js:310:12)
        at Module.require (module.js:365:17)
        _________________________________________________________________

        Seems like I’m closing in on it, the errors are getting shorter.

        Sorry to be a pain, I do appreciate the help.

        • Ravi Saive says:

          @Alan,

          I am not familiar with Wetty, but still I think the server-static module is missing and you need to install through npm as shown:

          # npm install serve-static
          

          Let me know after you installing the above module, are you able to execute node app.js -p 8080 command?

          • Alan says:

            There was another NPM module that it complained about missing too. Did some Googling and found the NPM website, and looked at the services it needed. Did NPM installs on those items, then it worked.

            Between the help here, and doing some brainstorming, I’m figuring out how to make things work.

            Now, if I could just figure out how to have Wetty start on a reboot, I’d be good. Right now, I have to login to the machine, start the service, and then I can access it with a web browser. The terminal I opened to add the command has to stay open, though, which kind of defeats the purpose.

            I don’t really need a secure connection for it; the port isn’t available to the outside, so I just want to have it start on regular HTTP, not HTTPS.

            Wanted to be able to access it from inside my home network with my cellphone, but for some reason, it doesn’t pop up the keyboard on my phone after I connect(I see the login prompt, but my phone’s browser doesn’t recognize that it needs keyboard input). I haven’t tried my Android tablet, but I suspect it will have the same result.. Not sure how to resolve that, but I’ll try to figure it out.

            Of course, if I could find a terminal application for my Android phone that actually allows me to SSH into Linux boxes on my home network, that might even eliminate the need for Wetty for anything other than the Windows box.

            Thank you again to everyone that has helped. I am an amateur at this, and it’s a learning curve, but I’m enjoying learning Linux.

        • @Alan,
          I am replying to this comment because I didn’t find the Reply link on the one below. If you’re still looking for an application that allows you to SSH into your Linux servers using your Android phone, I’d highly recommend JuiceSSH (https://juicessh.com/). I’ve used it in a production environment and gets the job done pretty well. Hope it helps.

  3. Jalal Hajigholamali says:

    Hi,
    Thanks for nice article

  4. Ivaylo says:

    Trying to identify whether there is an option to leverage certificates with Wetty so that the connection will be based on public / private key pairs.

    • @Ivaylo,
      As Wetty works over a web connection, I would say it’s best to go with the certificates (you may want to consider using one signed from a CA if you don’t want your users to run into the “This connection is not trusted” message). Otherwise, feel free to check the GitHub repository for further ideas on how to use Wetty. You may even suggest this option be included in future releases of the program.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 300K+ Linux Users
  1. 177,942
  2. 8,310
  3. 37,548

Are you subscribed?