Shellinabox Gentoo Init Script

I’ve been playing around with ShellInABox and I think it is quite neat. From the website:

Shell In A Box implements a web server that can export arbitrary command line tools to a web based terminal emulator. This emulator is accessible to any JavaScript and CSS enabled web browser and does not require any additional browser plugins.

So basically it gives you a shell to your local system wherever you go (as long as you have a browser that was released since the turn of the century). This can be especially handy if you are on a public machine without permissions to install software (such as putty). The only dis-advantage is that the remote machine has to be running shellinabox, so this will not work for shared hosting environments. However, if you setup a shellinabox machine, you can then SSH into other boxes that aren’t running the daemon.

I’m running Gentoo Linux on my utility machine, and shellinabox doesn’t ship with a gentoo init script. Please enjoy the one I have written below. Basically, you install shellinabox normally, then I copied its generated certs to /var/lib/shellingabox to be used for ssh connections.

Corrections and improvements are appreciated.


# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
depend() {
        need net
start() {
        ebegin "Starting Shellinabox"
        start-stop-daemon --start --pidfile $PIDFILE --exec $CMD -- --cert $CERT_DIR -b=$PIDFILE
        eend $?
  1. No comments yet.
(will not be published)