How to Access Secure Shell (SSH) Servers Through Standard Web Browsers

May 29, 2018

The Secure Shell Protocol (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. Its most notable applications are remote login and command-line execution.

Shell In A Box often called shellinabox (Unofficial fork of project Shell In A Box), that implements a web server (It has built-in web server) that can export arbitrary command line tools to a web based terminal emulator. Web based terminal emulator, can be accessible through any web browsers which enabled JavaScript and CSS, it does not require any additional browser plugins.

By default shellinaboxd daemon implements a web server, that listens on TCP port http://localhost:4200, which allows users to login with their username and password and to get access to their login shell.

All client-server communications are encrypted, if SSL/TLS certificates have been installed. During the installation a new self-signed SSL certificate automatically installed and details are available /var/lib/shellinabox to use HTTPS. Also we can install our own SSL certificate.

How to install Shellinabox from package manager

In distribution official repository shellinabox package is included, you can simple install the package using distribution package manager. Enable EPEL Repository to get shellinabox package in RHEL based systems.

For Debian/Ubuntu

$ sudo apt-get install openssl shellinabox

For RHEL/CentOS

$ sudo yum install openssl shellinabox

For Fedora

$ sudo dnf install openssl shellinabox

Start the Service in systemd based systems.

$ sudo systemctl start shellinaboxd.service

Start the Service in sysvinit based systems.

$ sudo service shellinaboxd start

How to install Shellinabox from Source

Make a note, The package which is included, into distribution official repository is old one. If you want latest one, i will advise you to build from source package.

Dependencies for RHEL/CentOS based systems

$ sudo yum install git openssl-devel pam-devel openssl zlib-devel autoconf automake libtool

Dependencies for Fedora

$ sudo dnf install git openssl-devel pam-devel openssl zlib-devel autoconf automake libtool

Dependencies for Debian based systems

$ sudo apt-get install git libssl-dev openssl libpam0g-dev zlib1g-dev dh-autoreconf

Clone source files from github repository and move to project directory.

$ sudo git clone https://github.com/shellinabox/shellinabox.git && cd shellinabox

Run autotools in project directory

$ sudo autoreconf -i

Run configure and make in project directory

$ sudo ./configure && make

Start the Service in system.

$ ./shellinaboxd

Open the browser and navigate to https://Your-IP-Adress:4200 and you can see the web-based SSH terminal.

Input the UserName and your Password to access the shell prompt.

Just play on it. For testing purpose, i’m going to list the current directory files and folders.

Exit the session, you will be getting Connect button to re connect the shell.

Right-Click your mouse to get more handy options.