How To Install Shell In A Box - Access Remote Linux Servers

To Install Shell In A Box - Access Remote Linux Servers

A web based SSH terminal emulator Shell-in-a-box to Access Remote Linux Servers is explained in this article.

To install a Shell-in-a-box in Linux

Shell-in-a-box tool is inserted on various Linux distributions like Ubuntu, Debian and Linux Mint through default repositories. Use the “ apt-cache” command to search for Shell-in-a-box and use the “ apt-get” command to install it.

For Ubuntu, Debian, and Linux Mint

$ sudo apt-cache search shellinabox
$ sudo apt-get install openssl shellinabox

For CentOS, RHEL, and Fedora

Enable EPEL repository and install it with the help of “ yum” command. Download the file using wget and then install it using RPM on your system to enable the EPEL repository. Make sure you must be root user.

[root@linuxhelp ~] # wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
--2016-06-14 13:27:08--  http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Resolving download.fedoraproject.org... 67.219.144.68, 140.211.169.206, 5.175.150.50, ...
Connecting to download.fedoraproject.org|67.219.144.68|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://free.nchc.org.tw/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm [following]
--2016-06-14 13:27:10--  https://free.nchc.org.tw/fedora-epel/6/x86_64/epel-release-6-8.noarch.rpm
Resolving free.nchc.org.tw... 211.73.64.9, 2001:e10:3c00:8::e274
Connecting to free.nchc.org.tw|211.73.64.9|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14540 (14K) [application/x-redhat-package-manager]
Saving to: “ epel-release-6-8.noarch.rpm” 

100%[=============================================> ] 14,540      62.0K/s   in 0.2s    

2016-06-14 13:27:12 (62.0 KB/s) - “ epel-release-6-8.noarch.rpm”  saved [14540/14540]
[root@linuxhelp ~] # rpm -ivh epel-release-6-8.noarch.rpm 
warning: epel-release-6-8.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY
Preparing...                ########################################### [100%]
   1:epel-release           ########################################### [100%]

Install Shell-in-a-box and openssl from the that repository

[root@linuxhelp ~] # yum install openssl shellinabox
Loaded plugins: aliases, changelog, fastestmirror, kabi, presto, refresh-packagekit,
              : security, tmprepo, verify, versionlock
Loading support for CentOS kernel ABI
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink                                                   | 4.8 kB     00:00     
 * base: centos.excellmedia.net
 * epel: mirror.rise.ph
 * extras: centos.excellmedia.net
 * updates: centos.excellmedia.net
epel                                                            | 4.3 kB     00:00     
epel/primary_db                                                 | 5.8 MB     02:02     
Resolving Dependencies
-->  Running transaction check
--->  Package openssl.x86_64 0:1.0.1e-42.el6_7.4 will be updated
-->  Processing Dependency: openssl = 1.0.1e-42.el6_7.4 for package: openssl-devel-1.0.1e-42.el6_7.4.x86_64
--->  Package openssl.x86_64 0:1.0.1e-48.el6_8.1 will be an update
--->  Package shellinabox.x86_64 0:2.19-1.el6 will be installed
-->  Running transaction check
.
.
.
Is this ok [y/N]: y
Downloading Packages:
Setting up and reading Presto delta metadata
updates/prestodelta                                             |  38 kB     00:00     
Processing delta metadata
Download delta size: 664 k
.
.
.
Installed:
  shellinabox.x86_64 0:2.19-1.el6                                                      

Updated:
  openssl.x86_64 0:1.0.1e-48.el6_8.1                                                   

Dependency Updated:
  openssl-devel.x86_64 0:1.0.1e-48.el6_8.1                                             

Complete!

To configure a Shell-in-a-box

Shell-in-a-box listens on TCP port 4200. At the time of installation, a new self-signed SSL certificate is created to use HTTPS protocol under “ /var/lib/shellinabox” .

[root@linuxhelp~] # vim  /etc/sysconfig/shellinaboxd

After exit from the configuration file, start Shell-in-a-box by using the following command.

[root@linuxhelp~] # service shellinaboxd start

Open the browser and navigate to https://< ip_address> :4200 (here 4200 is the default port number for shell-in-a-box service)

To verify Shell-in-a-box

Verify Shell-in-a-box by executing “ netstat” command.

[root@linuxhelp ~] # netstat -nap | grep shellinabox

Open the sysconfig file to edit the port number.

[root@linuxhelp ~] # vim /etc/sysconfig/shellinaboxd

Navigate to https://< IP_Adress> :1991 and login with your username and password

To use various features and actions, like changing the feel and look of your shell.


To enter into terminal after exit, click connect button.

FAQ
Q
what is Shell In A Box?
A
Shell In A Box is a web-based SSH terminal emulator Shell-in-a-box to Access Remote Linux Servers.
Q
How to Install Shell In A Box on Open SUSE?
A
In Open SUSE distribution use "zypper install openssl shellinabox" for installing Shell In A Box.
Q
Everything went well and service also looks good in running state, but I couldn't able to access it with Shell In A Box?
A
Your custom port should be added on your firewalld and iptables.
Q
Does this Shell In A Box has any default port or we can specify custom port?
A
You can specify custom port for Shell In A Box in "/etc/sysconfig/shellinaboxd"
Q
The cursor keeps blinking like anything in Shell In A Box, how to disable it?
A
When you right click on your web interface you will get a option called "blinking cursor disable it"