Shell in A Box – Terminal en interfaz web

Shell In A Box implementa un servidor web que puede exportar herramientas arbitrarias de línea de comandos a un emulador de terminal basado en la web. Este emulador es accesible para cualquier navegador web habilitado para JavaScript y CSS y no requiere ningún complemento adicional del navegador.

Lo primero que haremos será instalar la herramienta desde el terminal:

sudo apt-get install openssl shellinabox

Una vez instalado verificamos el fichero de configuración del shellinabox:

sudo nano /etc/default/shellinabox
------------------------------------
#SShould shellinaboxd start automatically
SHELLINABOX_DAEMON_START=1
# TCP port that shellinboxd's webserver listens on
SHELLINABOX_PORT=4200
# Parameters that are managed by the system and usually should not need
# changing:
# SHELLINABOX_DATADIR=/var/lib/shellinabox
# SHELLINABOX_USER=shellinabox
# SHELLINABOX_GROUP=shellinabox
# Any optional arguments (e.g. extra service definitions).  Make sure
# that that argument is quoted.
#   Beeps are disabled because of reports of the VLC plugin crashing
#   Firefox on Linux/x86_64.
SHELLINABOX_ARGS="--no-beep"

Como podemos observar en la línea SHELLINABOX_PORT=4200 el programa está escuchando a través del puerto 4200 que tiene configurado por defecto. Este puerto se puede modificar por cualquier otro aunque en caso de modificarlo será necesario reiniciar el servicio:

root@raspberrypi:/home/pi# sudo /etc/init.d/shellinabox restart
[ ok ] Restarting shellinabox (via systemctl): shellinabox.service.

Verificamos que el servicio se está ejecutando en el puerto que hemos configurado:

root@raspberrypi:/home/pi# sudo netstat -nap | grep shellinabox
tcp        0      0 0.0.0.0:4200            0.0.0.0:*               LISTEN      6405/shellinaboxd   
unix  3      [ ]         STREAM     CONNECTED     115965   6405/shellinaboxd    
unix  3      [ ]         STREAM     CONNECTED     114416   6406/shellinaboxd    
unix  3      [ ]         STREAM     CONNECTED     114415   6405/shellinaboxd 

Y por último, simplemente abrimos un navegador e introducimos la dirección del equipo más el puerto asignado:

https://IP-del-equipo:4200