Home>

The following content analyzes from the introduction of wetty, environment preparation, wetty installation, and verification.For details, please see below.

Wetty introduction

wetty is an open source web-based ssh developed using node.js and websockets. Please refer to web-based ssh for more information.

For the details of wetty, please refer tohttps://github.com/krishnasrinivas/wetty.

Environmental preparation

Because wetty is written in node.js, we need to install the relevant node.js environment in advance. Check out this blog post.

3. wetty installation

Run the following command to install,

$git clonehttps://github.com/krishnasrinivas/wetty

$cd wetty

$sudo npm install

The installation process may go wrong.Please refer to the possible problems below.

4. Verification

After the installation is complete,Then run the following command to start the wetty service and listen on port 3000.

$node app.js -p 3000

Then open your browser,Enter and then enter the password. After successful login, you can perform command line operations.Results as shown below,

5. Possible problem handling

5.1 Installation error:"use" is not a member of "node ::buffer"

Because the node I installed is version 4.1.1, it is too new. The pty.js that wetty originally relied on is too old, causing compilation problems.Modify the package.json in the following wetty source code directory, and modify the dependent pty.js to the latest version 0.3.0 (originally ^ 0.2.7-1). save document,Then re-run the sudo npm install command.

5.2 ssh access failed

After starting the wetty service, an error similar to the following screenshot "ssh:connect to host localhost port 22:connection refused" was reported when typing in the browser.

Run the following commands to reinstall openssl-client and openssl-server,

$sudo apt-get remove openssh-client openssh-server

$sudo apt-get installopenssh-client openssh-server

ps:learn linux command

The tty command is used to print the name of the terminal connected to standard input.If/dev/console is displayed, this terminal is a console terminal;

If/dev/pts/n is displayed, the terminal is a virtual terminal (a terminal connected to the linux server remotely). By checking that the return code of the tty command is 0, confirm that the standard input is a terminal.

sh- #tty

/dev/console

sh- #echo $?

0

sh- #tty

/dev/pts/6

With the following command,We know that/dev/console is a character device (the Linux system treats almost all devices as files),

sh- #ls -l/dev/console

crw-r--r-- 1 root root 5, 1 jan 1 00:11/dev/console

The above are the installation and use instructions for tty under linux system that we share with you.Hope you like it.

  • Previous jQuery drag layout to save results to database
  • Next Access validation setting method for HTML pages in ASPNET