Home » Home Server » How to install Shellinabox on ubuntu?

How to install Shellinabox on ubuntu?

Shell In A Box implements a web server that listens on a specified port and offers a web-based terminal emulator to remotely control you Linux Server. This post explains how to install Shellinabox on Ubuntu. It runs as an AJAX web application listening to port 4200 by default and available at http://localhost:4200. It allows users to login using their username and password and grants access to their login shell, exactly like SSH remote access. Any modern JavaScript and CSS enabled browser will be able to access the published service without requiring additional plugins. More details are available in the manual page. Recently, I described how to install SSH server on Ubuntu. Shellinabox adds a layer of convenience to your SSH server. While the procedure below describes how to install Shellinabox on Ubuntu, it may work on other distributions as well.

Install Shellinabox

Download Shellinabox

Whether or not you need to download and the way to download depends on what release of Ubuntu you are one. Shellinabox is available through the Universe repository for many releases, including 12.10 Quantal Quetzal. So the first step is to ensure that your Universe repository is enabled:

sudo nano /etc/apt/sources.list
Sources List – Universe Repository

Ensure that the Universe Repository for your release is not commented out (there should be no # in front of the colored lines). Next update and search the apt cache for Shellinabox:

sudo apt-get update
sudo apt-cache search shellinabox

If the search returns a result, then you can install Shellinabox from the repository. If not can download the .deb or .rpm packages for your distribution from here. This tutorial shows you how to install Shellinabox on Ubuntu 12.04 LTS, for which the download commands are given below:

32-bit / 64-bit:

Both 32-bit (shellinabox_2.14-1_i386.deb) and the 64-bit (shellinabox_2.14-1_amd64.deb) binaries are available here. Or, you could use one of the commands below.

wget http://archive.ubuntu.com/ubuntu/pool/universe/s/shellinabox/shellinabox_2.14-1_i386.deb
Or 
wget http://archive.ubuntu.com/ubuntu/pool/universe/s/shellinabox/shellinabox_2.14-1_amd64.deb

Recommended Reading:

Install Shellinabox

After downloading, you can install Shellinabox using the following command on Ubuntu (or you can use your GUI package installer that comes with many desktop environments):

32-bit:

sudo dpkg -i shellinabox_2.14-1_i386.deb

64-bit:

sudo dpkg -i shellinabox_2.14-1_amd64.deb

Access Shellinabox

After you install Shellinabox, you can access Shellinabox using the following URL:

http://localhost:4200

Login using your username and password and you should be directed to your shell. You can right-click to access several options and actions, including changing the look of your shell. You can start, stop, or reload your Shellinabox using the following commands:

sudo service shellinabox start
sudo service shellinabox stop
sudo service shellinabox reload

Recommended Improvements

I strongly recommend that you follow the steps below to secure your Shellinbox and make it more convenient to use:

  1. Create bash aliases, as described in this post, to make it convenient to start, stop, and reload Shellinabox:
    alias shellstart='sudo service shellinabox start'
    alias shellstop='sudo service shellinabox stop'
    alias shellreload='sudo service shellinabox reload'
    

    You can now use shellstart, shellstop, and shellreload from commandline to start, stop, and reload Shellinabox.

  2. Change default port, enable SSL, enable Apache Authentication Realm and reverse proxy, as described in this post, to secure your Shellinabox falling to the hands of hackers.

Install Shellinabox and enjoy the easy SSH access to your Linux server. Don’t forget to secure it prior to enabling access through the internet.

We Are Hiring: Familiar with Media Streaming, HTPC, Home Server, Smart Home, and Home Automation topics? Write about it and earn money. No writing experience needed. APPLY HERE.

Get 20% OFF with IPVanish VPN:

♦   Hide your browsing and streaming activity: No logs and no tracking
♦   Access geo-restricted content from anywhere
♦   Encrypt and anonymize: Kodi, Plex, Downloads, Personal Info
♦   Windows, Mac, Linux, Android, iOS, Router, and more.
♦   Money back guarantee - Sign Up Now

About the author

Anand

Anand is a self-learned computer enthusiast, a part-time blogger, and a Food Scientist by career. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs on htpcbeginner.com and smarthomebeginner.com.

Join the other 110,000 followers