'\" t .\" shellinaboxd.man -- Make command line applications available as AJAX web applications .\" Copyright (C) 2008-2010 Markus Gutschke .\" .\" This program is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License version 2 as .\" published by the Free Software Foundation. .\" .\" This program is distributed in the hope that it will be useful, .\" but WITHOUT ANY WARRANTY; without even the implied warranty of .\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the .\" GNU General Public License for more details. .\" .\" You should have received a copy of the GNU General Public License along .\" with this program; if not, write to the Free Software Foundation, Inc., .\" 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. .\" .\" In addition to these license terms, the author grants the following .\" additional rights: .\" .\" If you modify this program, or any covered work, by linking or .\" combining it with the OpenSSL project's OpenSSL library (or a .\" modified version of that library), containing parts covered by the .\" terms of the OpenSSL or SSLeay licenses, the author .\" grants you additional permission to convey the resulting work. .\" Corresponding Source for a non-source form of such a combination .\" shall include the source code for the parts of OpenSSL used as well .\" as that of the covered work. .\" .\" You may at your option choose to remove this additional permission from .\" the work, or from any part of it. .\" .\" It is possible to build this program in a way that it loads OpenSSL .\" libraries at run-time. If doing so, the following notices are required .\" by the OpenSSL and SSLeay licenses: .\" .\" This product includes software developed by the OpenSSL Project .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/) .\" .\" This product includes cryptographic software written by Eric Young .\" (eay@cryptsoft.com) .\" .\" .\" The most up-to-date version of this program is always available from .\" http://shellinabox.com .\" .TH SHELLINABOXD 1 "Sep 11, 2010" .SH NAME shellinaboxd \- publish command line shell through AJAX interface .SH SYNOPSIS .TP .B shellinaboxd [\ \fB-b\fP\ | \fB--background\fP[\fB=\fP\fIpidfile\fP]\ ] #ifdef HAVE_OPENSSL [\ \fB-c\fP\ | \fB--cert=\fP\fIcertdir\fP\ ] #endif [\ \fB--cert-fd=\fP\fIfd\fP\ ] [\ \fB--css=\fP\fIfilename\fP\ ] [\ \fB--cgi\fP[\fB=\fP\fIportrange\fP]\ ] [\ \fB-d\fP\ | \fB--debug\fP\ ] [\ \fB-f\fP\ | \fB--static-file=\fP\fIurl\fP:\fIfile\fP\ ] [\ \fB-g\fP\ | \fB--group=\fP\fIgid\fP\ ] [\ \fB-h\fP\ | \fB--help\fP\ ] [\ \fB--linkify\fP=[\fBnone\fP|\fBnormal\fP|\fBaggressive\fP]\ ] [\ \fB--localhost-only\fP\ ] [\ \fB--no-beep\fP\ ] [\ \fB-n\fP\ | \fB--numeric\fP\ ] [\ \fB--pidfile=\fP\fIpidfile\fP\ ] [\ \fB-p\fP\ | \fB--port=\fP\fIport\fP\ ] [\ \fB-s\fP\ | \fB--service=\fP\fIservice\fP\ ] #ifdef HAVE_OPENSSL [\ \fB-t\fP\ | \fB--disable-ssl\fP\ ] #endif [\ \fB--disable-ssl-menu\fP\ ] [\ \fB-q\fP\ | \fB--quiet\fP\ ] [\ \fB-u\fP\ | \fB--user=\fP\fIuid\fP\ ] [\ \fB--user-css=\fP\fIstyles\fP\ ] [\ \fB-v\fP\ | \fB--verbose\fP\ ] [\ \fB--version\fP\ ] .SH DESCRIPTION The .B shellinaboxd daemon implements a webserver that listens on the specified .IR port . The web server publishes one or more .I services that will be displayed in a VT100 emulator implemented as an AJAX web application. By default, the port is 4200 and the default service URL is .IR http://localhost:4200/ . .P If no particular .I service was requested, the server launches .B /bin/login querying the user for their username and password. It then starts the user's default login shell. .P Any modern JavaScript and CSS enabled browser will be able to access the published .I service without requiring additional plugins. .SH OPTIONS The following command line parameters control the operation of the daemon: .TP \w'\-b\ |\ 'u \fB-b\fP\ | \fB--background\fP[\fB=\fP\fIpidfile\fP] Launch .B shellinaboxd as a background daemon process. Optionally, write the process id to .IR pidfile . #ifdef HAVE_OPENSSL .TP \fB-c\fP\ |\ \fB--cert=\fP\fIcertdir\fP If built with SSL/TLS support enabled, the daemon will look in .I certdir for any certificates. If unspecified, this defaults to the current working directory. If the browser negotiated a .B Server Name Identification the daemon will look for a matching .I certificate-\f[BI]SERVERNAME\fP.pem file. This allows for virtual hosting of multiple server names on the same IP address and port. If no .B SNI handshake took place, it falls back on using the certificate in the .I certificate.pem file. The administrator should make sure that there are matching certificates for each of the virtual hosts on this server, and that there is a generic .I certificate.pem file. If no suitable certificate is installed, .B shellinaboxd will attempt to invoke .B /usr/bin/openssl and create a new self-signed certificate. This only succeeds if, after dropping privileges, .B shell\%ina\%boxd has write permissions for .IR certdir . Most browsers show a warning message when encountering a self-signed certificate and then allow the user the option of accepting the certificate. Due to this usability problem, and due to the perceived security implications, the use of auto-generated self-signed certificates is intended for testing or in intranet deployments, only. .TP \fB--cert-fd=\fP\fIfd\fP Instead of providing a .B --cert directory, it is also possible to provide a filedescriptor .I fd where the certificate and key can be retrieved. While this option disables .B SNI support, it does offer an alternative solution for securely providing the private key data to the daemon. #endif .TP \fB--css=\fP\fIfilename\fP Sometimes, it is not necessary to replace the entire style sheet using the .B --static-file option. But instead a small incremental change should be made to the visual appearance of the terminal. The .B --css option provides a means to append additional style rules to the end of the default .B styles.css sheet. More than one .B --css option can be given on the same command line. .TP \fB--cgi\fP[\fB=\fP\fIportrange\fP] Instead of running .B shellinaboxd as a permanent process, it can be demand-loaded as a CGI web server extension. When doing so, it will spawn a server that lives for the duration of the user's session. If an optional .I portrange of the form .BR MINPORT-MAXPORT has been provided, the server limits itself to these port numbers. They should be configured to pass through the firewall. The .B --cgi option is mutually exclusive with the .BR --background , .B --pidfile and .B --port options. In order to be useful as a CGI script, the .B shellinaboxd binary probably will have to be made .BR setuid-root . This is currently a discouraged configuration. Use with care. .TP \fB-d\fP\ |\ \fB--debug\fP Enables debugging mode, resulting in lots of log messages on .IR stderr . This option is mutually exclusive with .B --quiet and .BR --verbose . .TP \fB-f\fP\ |\ \fB--static-file=\fP\fIurl\fP:\fIfile\fP The daemon serves various built-in resources from URLs underneath the .I service mount points. One or more .B --static-file options allow for overriding these resources with customized externally provided .IR files . The .I url can either be an absolute or a relative path. In the former case, it overrides exactly one built-in resource for one specific .IR service , whereas in the latter case it overrides resources for each defined .IR service . The following resources are available for customization: .RS .TP \w'ShellInABox.js\ \ \ 'u .B beep.wav audio sample that gets played whenever the terminal BEL is sounded. .TP .B favicon.ico favicon image file that is displayed in the browser's navigation bar. .TP .B ShellInABox.js JavaScript file implementing the AJAX terminal emulator. .TP .B styles.css CSS style file that controls the visual appearance of the terminal. .TP .B print-styles.css CSS style file that controls the visual appearance of printed pages when using the VT100 transparent printing feature. .P It is not recommended to override the root HTML page for a particular .IR service . Instead, move the service to an anonymous URL and serve a .I static-file that references the .I service in an .IR