1. Shellinabox Introduction
Shellinabox is a Web browser-based remote terminal emulator built using Ajax technology, which means that after the software is installed, the server side does not need to open the SSH service, the remote host can be operated through a Web browser, but your web browser needs to support ajax/ JavaScript and CSS, so you can use http://localhost:4200 to log in to your system, and SSL/TLS certificates are enabled by default and require https://localhost:4200 to log in.
By default, Shellinabox uses port 4200 of the TCP protocol, so if your system has a firewall enabled, please release Port 4200.
2. Shellinabox installation and configuration of 2.1 Shellinabox installation
The Shellinabox package has a source package and RPM package, the simplest way is to install through the RPM package.
SOURCE Bundle: http://shellinabox.googlecode.com/files/shellinabox-2.10.tar.gz
RPM Package:
Http://pkgs.org/centos-6/epel-x86_64/shellinabox-2.14-24.git88822c1.el6.x86_64.rpm.html
2.1.2 Source Package Installation
Extract:
[[email protected] software] #tar-ZXVF shellinabox-2.10.tar.gz
Go to unzip directory, compile and install:
[[Email protected]]# CD shellinabox-2.10
[[Email protected]]#./configure && make && make install
You can also use--prefix to specify the installation path at compile time.
Such as:
./configure--prefix=/usr/local/shellinabox
The installation will be installed in the/usr/local/shellinabox directory, and if not specified, it will be installed to the/usr/local/bin directory by default.
By default, the contents of/etc/sysconfig/shellinaboxd are as follows:
1[Email protected] ~]# More/etc/sysconfig/Shellinaboxd2# Shellincha Boxdaemon configuration3# for details SeeshellinaboxdManspage4 # Basic Options5User=Shellinabox6group=Shellinabox7certdir=/var/lib/Shellinabox8port=42009opts="--disable-ssl-menu-s/:login"Ten # Additionalexamples with custom options: One# Fancyconfiguration with right-click menu choice forblack-on-White : A#OPTS ="--user-css normal:+black-on-white.css,reverse:-white-on-black.css--disable-ssl-menu-s/:LOGIN" -# simpleconfiguration forrunning it as an SSH console with SSL disabled: -# opts="-t-s/:ssh:host.example.com" the[Email protected] ~]#
Comments:
User and Group: Specifies which users and groups to start the service.
Certdir: Specifies the directory where the SSL certificate is stored.
PORT: Specifies the listening port of the Shellinaboxd service. The default is 4200.
OPTS: Set some additional parameters.
The common opts are as follows:
-T: Turn off SSL/TLS support. That is, you do not need to use an HTTPS connection, you can connect directly with HTTP.
Start and stop of the service:
/etc/init.d/shellinaboxd start/etc/init.d/shellinaboxd restart/etc/init.d/ Shellinaboxd Stop
Observe the port on which the service listens:
[[Email protected] ~] #netstat-TNLP | grep Shellinabox
TCP 0 0 0.0.0.0:4200 0.0.0.0:* LISTEN 22455/shellinaboxd
[Email protected] ~]#
Set up auto start for service:
[[Email protected] ~] #chkconfig shellinaboxd--level
[[Email protected] ~] #chkconfig--list | grep Shellinaboxd
Shellinaboxd 0:off 1:off 2:off 3:on 4:on 5:on 6:off
[Email protected] ~]#
2.2.2 Instructions for starting a service when installing with a source package
When installing Shellinabox with a source package, the way to start the service is as follows:
< Installation path >/bin/shellinaboxd options
The common options are as follows:
-B: Run the service in the background
-U: Specifies the user running the service, which defaults to nobody
-G: Specifies the group that runs the service, default is nobody
-P: Specifies the listening port of the Shellinaboxd
-T: Indicates the support to turn off SSL/TLS.
-C: Specifies the directory where the SSL certificate resides.
Start the service:
/usr/local/bin/shellinaboxd-b-t-u Root
Observe the port on which the service listens:
[[email protected] bin] #netstat-TUNLP | grep Shellinabox
TCP 0 0 0.0.0.0:4200 0.0.0.0:* LISTEN 6765/shellinaboxd
[Email protected] bin]#
Stop service:
Killall-9 Shellinaboxd
Set up auto start for service:
To edit the/etc/rc.d/rc.local, add the following:
/usr/local/bin/shellinaboxd-b-t-u root-g Root
At this point, using 10.16.59.100:4200 access, if the access is successful, the installation has succeeded
Shellinabox Web browser-based terminal emulator