Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

Shell in a Box – Remote Linux Server via Web Browser

  • Last Updated : 23 Jun, 2021

For accessing Linux-based machines, Secure Shell (SSH) is used and for accessing Windows-based machines, Remote Desktop Protocol (RDP) is used. Putty is the most famous SSH client in windows. Just like that, SSH can be used for accessing the Linux server remotely via a web browser using shellinabox application.

What is shellinabox?

Shellinabox is a free, open-source, web-based terminal emulator that uses Ajax technology to provide the appearance of a native shell. It was developed by Markus Gutschke. It has the following features:

  1. Shellinabox has a built-in web server that lets you run a web-based SSH client on a specified port.
  2. A web terminal emulator will be provided for remotely accessing the Linux Server SSH Shell from any web browser that supports AJAX/JavaScript and CSS without using any extra browser plugins like FireSSH.
  3. If SSL/TLS certificates are installed, then all client-server communications are encrypted. When shellinabox is installed, at that time a new self-signed SSL certificate will be installed, the details can be found in /var/lib/shellinabox (to use HTTPS). One can install own SSL certificate.

/var/lib/shellinabox

Installation

For installing shellinabox on a Debian/Ubuntu-based system, follow the given command:

$ sudo apt-get install shellinabox

Installation



How to Use Shellinabox

After successful installation, let’s see the next steps to follow for using shellinabox:

Step 1- Start the shellinabox daemon using the following command:

$ sudo /etc/init.d/shellinabox start

Step 2- By default, shellinaboxd listens on TCP port 4200, but it is possible to change it. For changing the port number, edit the port number using the following command:

$ sudo vi /etc/default/shellinabox

Change post number

Step 3- Restart the shellinabox daemon using the following command:

$ sudo /etc/init.d/shellinabox restart

Restart shellinabox

Step 4- Now verify whether Shellinabox is running on the port that was changed or not using the following command:

sudo netstat -nap | grep shellinabox

Changed port number

Step 5- Next step is to open a web browser, and navigate to “https://server_ip_address:port_number”. A web-based SSH terminal can be seen on the screen that will tell to log in using your username and password like this:

Login in the SSH

Step 6- Right-click in the browser to get different features, and if you are inactive for some time, the sessions get disconnected. Connect again by clicking on connect the button.

Connected

Note: DO NOT forget to secure the shellinabox with a firewall and open the assigned port(default one or the manual port you gave) for only specific IP Addresses to access your Linux shell remotely. This will protect from attackers.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!