How to Access the Linux Server From Web Browser Using Shellinabox on CentOS 7.6

Access the Linux Shell from web browser Using ShellInabox On CentOs 7.6

Default port :4200
Configuration file :/etc/sysconfig/shellinaboxd

Pre-requisites:

epel-repository

Installation procedure:

Install the epel repository that is essential for the installation of shellinabox as follows

[root@localhost ~]# yum install epel-release yum-utils -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: centos.myfahim.com
 * extras: centos.myfahim.com
 * updates: centos.myfahim.com
base                                                                                                                  | 3.6 kB  00:00:00     
extras                                                                                                                | 3.4 kB  00:00:00     
updates                                                                                                               | 3.4 kB  00:00:00     
Package yum-utils-1.1.31-50.el7.noarch already installed and latest version
Resolving Dependencies
--> Running transaction check
---> Package epel-release.noarch 0:7-11 will be installed
--> Finished Dependency Resolution
.
.
.
.
.
Installed:
  epel-release.noarch 0:7-11                                                                                                                 

Complete!

Install shellinabox and openssl dependency by executing the following command

 [root@localhost ~]# yum install shellinabox openssl -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                                  | 8.1 kB  00:00:00     
 * base: centos.myfahim.com
 * epel: mirror.horizon.vn
 * extras: centos.myfahim.com
 * updates: centos.myfahim.com
epel                                                                                                                  | 5.3 kB  00:00:00     
.
.
.
.
.
Installed:
  shellinabox.x86_64 0:2.20-5.el7                                                                                                            

Updated:
  openssl.x86_64 1:1.0.2k-16.el7_6.1                                                                                                         

Dependency Updated:
  openssl-libs.x86_64 1:1.0.2k-16.el7_6.1                                                                                                    

Complete!

Start the service of Shellinabox

[root@localhost ~]# systemctl start shellinaboxd

Verify the listening port of shellinabox using netstat

[root@localhost ~]# netstat -tulpn | grep shellinabox
tcp        0      0 0.0.0.0:4200            0.0.0.0:*               LISTEN      17815/shellinaboxd  

Navigate to Shellinabox configuration file

[root@localhost ~]# vim /etc/sysconfig/shellinaboxd
# Shell in a box daemon configuration
# For details see shellinaboxd man page

# Basic options
USER=shellinabox
GROUP=shellinabox
CERTDIR=/var/lib/shellinabox
PORT=4200
OPTS="--disable-ssl-menu -s /:LOGIN"


# Additional examples with custom options:

# Fancy configuration with right-click menu choice for black-on-white:
# OPTS="--user-css Normal:+black-on-white.css,Reverse:-white-on-black.css --disable-ssl-menu -s /:LOGIN"

# Simple configuration for running it as an SSH console with SSL disabled:
# OPTS="-t -s /:SSH:host.example.com"

Switch over to your browser and enter the URL as shown below Click Advanced ,Add exception and then Confirm the security exception Enter the login credentials of a regular user to access the linux server With this, Accessing the linux shell from web browser using shellinabox on centos 7.6 comes to end.

FAQ
Q
What is the configuration file of shellinabox On CentOS 7.6?
A
The configuration file of Shellinabox is /etc/sysconfig/shellinaboxd On CentOS 7.6
Q
Is it possible to bl0ck the Shellinabox shell Access?
A
Yes,it is possible to block the shell access in Shellinabox
Q
What is the default port of Shellinabox?
A
The default port of Shellinabox is 4200
Q
Does Shellinabox require any additional browser plugins?
A
No,Shellinabox doesn't require any additional browser plugins
Q
Does Shellinabox work with JavaScript/CSS-enabled browsers?
A
Yes,Shellinabox works woth Javascript/CSS-enabled browsers.