Use of the web ssH terminal

Shell In A Box - A Web-Based SSH Terminal to Access Remote Linux Servers

Shell In A Box (pronounced as shellinabox) is a web based terminal emulator created by Markus Gutschke. It has a built-in web server that runs as a web-based SSH client on a specified port and prompt you a web terminal emulator to access and control your Linux Server SSH Shell remotely using any AJAX/JavaScript other CSS enabled browsers without the need of any additional browser plugins such as FireSSH.

In this tutorial, I describe how to install Shellinabox and access remote SSH terminal using a modern web browser on any machine. Web-based SSH is very useful when you are protected with firewall and only HTTP(s) traffic can get through.

Installing Shellinabox on Linux

By default, Shellinabox tool is included on many Linux distributions through default repositories, including Debian, Ubuntu other Linux Mint.

Make sure that your repository is enabled and available to install Shellinabox from the that repository. To check, do a search for Shellinabox with the "apt-cache"Command and then install it using"apt-get”Command. `

On Debian, Ubuntu and Linux Mint
$ sudo apt-cache search shellinabox $ sudo apt-get install openssl shellinabox
On RHEL, CentOS and Fedora

On Red hat based distributions, you need to first have enable EPEL repository and then install it using the following "yum”Command. (Fedora users don’t need to enable EPEL, it's already a part of Fedora project).

# yum install openssl shellinabox

Configuring Shellinabox

By default, shellinaboxd lists on TCP port 4200 on localhost. For security reason, I change this default port to a random (i.e. 6175) to make it difficult for anyone to reach your SSH box. Also, during installation a new self-signed SSL certificate automatically created under "/ var / lib / shellinabox"To use HTTPS protocol.

On Debian, Ubuntu and Linux Mint
$ sudo vi / etc / default / shellinabox # TCP port that shellinboxd's webserver listens on SHELLINABOX_PORT = 6175 # specify the IP address of a destination SSH server SHELLINABOX_ARGS = "- o-beep -s /:SSH:" # if you want to restrict access to shellinaboxd from localhost only SHELLINABOX_ARGS = "- o-beep -s /:SSH: --localhost-only"
On RHEL, CentOS and Fedora
# vi / etc / sysconfig / shellinaboxd # TCP port that shellinboxd's webserver listens on PORT = 6175 # specify the IP address of a destination SSH server OPTS = "- s /:SSH:" # if you want to restrict access to shellinaboxd from localhost only OPTS = "- s /:SSH: --localhost-only"

Starting Shellinabox

Once you've done with the configuration, you can start the service by issuing the following command.

On Debian, Ubuntu and Linux Mint
$ sudo service shellinaboxd start
On RHEL and CentOS
# service shellinaboxd start
On Fedora
# systemctl enable shellinaboxd.service # systemctl start shellinaboxd.service

Verify Shellinabox

Now let's verify whether Shellinabox is running on port 6175 using "netstat”Command.

$ sudo netstat -nap | grep shellinabox or # netstat -nap | grep shellinaboxtcp 0 0* LISTEN 12274 / shellinaboxd

Now open up your web browser, and navigate to https: // Your-IP-Adress: 6175. You should be able to see a web-based SSH terminal. Login using your username other password and you should be presented with your shell prompt.

You can right-click to use several features and actions, including changing the look and feel of your shell.

Make sure you secure you shellinabox on firewall and open 6175 port for specific IP address to access your Linux shell remotely.

Reference links

Shellinabox homepage

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

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee (or 2) as a token of appreciation.

We are thankful for your never ending support.