[Tutorial] Web based SSH terminal for the Raspberry Pi

So, the other day, i wrote about Onion Terminal. Despite this is a great Terminal, it relies on Onion lib, and this has a lot of dependencies to it: libcairo-dev, libxml2, libpng++-dev, …

Then, i discovered GateOne – a full featured HTML5 based web terminal for SSH access.

Despite this tutorial is for the Raspberry Pi, this will work without much changes in any Debian based system, such as Ubuntu and others.

GateOne
GateOne in action

 

I thought about writing this tutorial after trying out Shell-in-a-Box, by following this great write up from Remi Bergsma. I didn’t want to rely on a daemon for the terminal, than lighttpd or nginx for the web stuff. Also, there were a few glitches with my setup that didn’t made things as straightforward as they should – probably due do customization for RaspBMC that i’m running.

Sometimes you can’t just SSH to your terminal. You have a firewall or a proxy in your way, so, an HTTPS session is always handy.

The installation is pretty straightforward. Get the file, uncompress it, enter the dir, and run the setup script. But first, we need setuptools as a pre-requisite:

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
tar zxvf setuptools-0.6c11.tar.gz
cd setuptools-0.6c11
python setup.py build
python setup.py install

Then, clone the source from Git repository, and run the installer:

git clone https://github.com/liftoff/GateOne.git
cd GateOne
sudo python setup.py install

On the first run, a configuration file must be created. So, we’ll run GateOne and, when finished, close the program with CTRL+C.

sudo gateone

GateOne defaults to only allowing local connections, but we’ll need to be able to access it through our local network to make it usefull.

sudo nano /etc/gateone/conf.d/10server.conf

look for “origins” [you can search with CTRL+W], and add the Pi’s IP address to the list with the same sintax as the others. CTRL+O to save, CTRL+X to exit.

Restart the service,

sudo /etc/init.d/gateone restart

Go to the web browser on your local network and test: https://rpi-ip-address. Note the HTTPS on the address!

As a side note, this won’t work from the outside network.
If someone is interested in that, leave a comment. However, the best way to accomplish this is through a VPN.
Also, SSL certificate generation is out of scope for this article: this is just the basic howto.

5 thoughts on “[Tutorial] Web based SSH terminal for the Raspberry Pi”

  1. Hello!
    Thanks for this tutorial, very useful.
    I would like to know how to access GateOne from the internet. Can you explain how to do it? It would be really useful.
    Thanks!

  2. Thanks for the short yet very helpful tutorial!
    Also, changing the “address” line from “127.0.0.1” in the “10server.conf” allowed me to access it from the Internet.
    Don’t know how it will affect the rest of your system, but works for my purposes!

    1. Yes, it serves as a little ACL.
      However, i feel it’s better to have it only allowing local connections, then connecting to the Pi via VPN. This serves as an additional protection layer.

Leave a Reply

Your email address will not be published. Required fields are marked *