Shell in a Box – Remote Linux Server via Web Browser
Last Updated :
31 Jul, 2023
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:
- 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.
- 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.
- 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.
Similar Reads
Shell in a Box - Remote Linux Server via Web Browser
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
3 min read
Uploading a Reverse Shell to a Web Server in Kali Linux
We basically hack the webserver for gaining access to the system. We look into what is inside the web server and we want to have full control of the web server. Therefore we can download or access the uploaded content. In this article, we are using a reverse shell made with PHP. We are uploading the
3 min read
Setup Web Server Over Docker Container in Linux
Before setting up a server we must know the real meaning or definition of a server. So, the Server is a program that provides the client with any kind of services. For example, a web server provides our websites, a database server provides us data. This means every server has work to do and for ever
2 min read
Most Useful Commands to Manage Apache Web Server in Linux
Prerequisite: How do Web Servers work? Apache is one of the most widely used free, open-source Web Server applications in the world, mostly used in Unix-like operating systems but can also be used in windows. As a developer or system administrator, it will be very helpful for you to know about the A
3 min read
How to use SSH to connect to a remote server in Linux | ssh Command
Secure Shell, commonly known as SSH, is like a super-secure way to talk to faraway computers, called servers. It's like a secret tunnel on the internet that keeps your conversations safe and private. Imagine you're sending a letter, and instead of sending it openly, you put it in a magic envelope th
8 min read
How to Control Systemd Services on Remote Linux Server
Linux, SysV, and LSB init scripts are compatible with Systemd, a system and service manager. Aggressive parallelization capabilities are offered by Systemd, which also offers on-demand daemon starting and uses Linux cgroups to keep track of processes. Systemd also supports system snapshotting and re
2 min read
What is a Linux Server and Why use it
A Linux server is a computer running the Linux operating system designed to serve various functions, such as hosting websites, managing databases, and handling network services. In this article, we'll explore what Linux servers are and delve into the reasons why they are widely used in enterprise en
8 min read
How to display nc return value in Linux shell script?
When you need to monitor network connections and understand their status, creating a custom bash script can be an invaluable solution. This article demonstrates how to build a bash script that checks network connections using the nc command and displays the corresponding exit status. By providing a
6 min read
How to Create Reverse Shells with Netcat in Kali Linux?
Netcat is a command in Linux which is used to perform port listening, port redirection, port checking, or even network testing. Netcat is also called a swiss army knife of networking tools. This command is also used to create a reverse shell. Before getting in depth of reverse shell one must be awar
2 min read
Build a Simple static file web server in Node.js
In this article, we will build a static file web server which will list out all the files in the directory and on clicking the file name it displays the file content. Steps for creating a static file server is as follows: Step 1: Importing necessary modules, and defining MIME types which helps brows
4 min read