amuck-landowner

Running a web based terminal (ssh)

wlanboy

Content Contributer
I was looking for a web based terminal emulator and finally found "Shell In A Box".
It is a linux service that is running a webservice that uses JS/CSS to build up a great web based terminal.

Installation is easy because it is part of all major repositories:


apt-get install openssl shellinabox

The default settings are ok but you can change some values:


nano /etc/default/shellinabox

Content:


# Should 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 --localhost-only"

# specify the IP address and the post of a destination SSH
#SHELLINABOX_ARGS="--o-beep -s /:SSH:11.22.33.44 -p 22 --disable-ssl-menu"

One important setting:


--localhost-only

So you can use your favorite web server to secure the access to the local shellinabox service (recommended).

A lighttpd configuration would look like this:


$HTTP["host"] =~ "shell.domain.com" {
auth.backend = "htpasswd"
auth.backend.htpasswd.userfile = "/etc/lighttpd/shell"
auth.require = ("/" => (
"method" => "basic",
"realm" => "shell",
"require" => "valid-user"
))

proxy.balance = "fair"
proxy.server = ( "" => (
( "host" => "127.0.0.1", "port" => 4200 )
)
)
}

Some screenshots of the web frontend:

shellinabox1.jpg

shellinabox2.jpg

shellinabox3.jpg

shellinabox4.jpg
 

notFound

Don't take me seriously!
Verified Provider
I've used shellinabox for a few years, it's great, except on some connections and browsers very laggy. Specifically my college's computers, which is why I just boot Debian now and run through a tunnel on port80. Might try butterfly, seems interesting.
 
Last edited by a moderator:

wcypierre

New Member
There's this that is called GateOne which is awesome as well btw. But it is running on python so it is a bit memory intensive though
 

wcypierre

New Member
I have used GateOne on lowendspirit and it worked fine, never checked how much memory it used but that server was 128mb without swap. 

https://github.com/liftoff/GateOne
One master python process = ~28mb normally, ~40 on load.

One     shell (bash/sh/zsh)    = depending on how much of memory your shell uses

One              sshd                 =  ~600kb if I recall correctly

For each new tab or new connection,

One child python process = ~8mb

One     shell (bash/sh/zsh)    = depending on how much of memory your shell uses

One              sshd                 =  ~600kb if I recall correctly

Excluding the shell and sshd since it is needed in normal ssh connections anyway, it would take around 36mb for just two connections. while it'll take less than 5mb for normal ssh. It doesn't matter much for normal single usage, but it matters a lot for multiple user usage(like in university where everyone needs to ssh into the box to submit their coursework).
 

wlanboy

Content Contributer
Thank you for the suggestions.

Butterfly and GateOne are based on Python - not my first choice.

I will look at the port multiplexer sslh later.
 

Virtovo

New Member
Verified Provider
Does anyone know of a self hosted solution that takes this a little further to include a web based file editor as part it?  Ideally I'm looking for something like koding.com but self hosted.
 

dano

New Member
Gosh, had no idea the shell could be so fancy. After too many years of sys administration, I just use a multi-tab terminator or just default debian/ubuntu display.
 
  • Like
Reactions: Zen

D. Strout

Resident IPv6 Proponent
Does anyone know of a self hosted solution that takes this a little further to include a web based file editor as part it?  Ideally I'm looking for something like koding.com but self hosted.
Could always use vi or nano through the terminal! Otherwise, I don't know of anything. You could write your own in PHP or the like, but that gets complicated quickly. Syntax highlighting, AJAX saves, all that is best provided by something else.
 

kavanutz

New Member
Interesting.  It says it needs Java but are we talking server-side or client-side? (sorry I did kinda end up just skimming it)
Java only runs server-side.  There is no Java applet or anything like that.  The terminal data comes back as JSON through Web Sockets.
 

Munzy

Active Member
Bump of this thread....

Ok, I am looking for a ssh based terminal that actually requires you to authenticate to what ever you are connecting with. Not just thrown into an authenticated user. Any suggestions? Prefer PHP coding.
 
Top
amuck-landowner