Open In App

Shell in a Box – Remote Linux Server via Web Browser

Last Updated : 31 Jul, 2023
Improve
Improve
Like Article
Like
Save
Share
Report

Secure Shell (SSH) is employed to access Linux-based machines, while Remote Desktop Protocol (RDP) is employed for accessing Windows-based machines. Putty is a widely recognized SSH client for Windows. Similarly, to remotely access a Linux server via a web browser, the shellinabox application allows the utilization of SSH.

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. Built-in Web Server: Shellinabox includes a built-in web server, allowing users to run a web-based SSH client on a specific port. This convenient feature enables remote access to the Linux Server SSH Shell without the need for additional software installations.
  2. Web Terminal Emulator: With Shellinabox, users can remotely access the Linux Server SSH Shell through a web terminal emulator. This emulator functions seamlessly on any web browser supporting AJAX/JavaScript and CSS, eliminating the requirement for browser plugins such as FireSSH.
  3. SSL/TLS Encryption: To ensure secure communications between the client and server, Shellinabox supports SSL/TLS certificates. When Shellinabox is installed, it automatically installs a new self-signed SSL certificate, which can be found in the /var/lib/shellinabox directory for HTTPS usage. Users also have the option to install their own SSL certificates for enhanced security.

Installation of `shellinabox` in Linux

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

$ sudo apt-get install shellinabox

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

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

$ sudo /etc/init.d/shellinabox restart

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

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:

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.

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.

Conclusion

In this article, we discussed Shellinabox which is a web-based terminal emulator that allows remote access to Linux servers via a web browser. It features a built-in web server, web terminal emulator, and supports SSL/TLS encryption. By following the installation and configuration steps, users can easily set up and use shellinabox for remote administration. It is essential to secure shellinabox with a firewall and limit access to specific IP addresses for enhanced security.


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads