Ajaxterm web based terminal

Ajaxterm is a web application that uses Python and AJAX to make a terminal that you can log in to over the web. I decided to try it out tonight…

The installation is easy. Basically unpack the tar file somewhere and run the ajaxterm.py script. With no options specified, it will open localhost:8080 as a web server. If you connect to that port, it will attempt to log you in as if you had typed (as the user running the script) ’ssh localhost’. Seemed to work.

Next, I modified /etc/conf.d/apache2 to include mod_proxy:

APACHE2_OPTS="-D PYTHON -D DAV -D DAV_FS -D SVN -D PROXY"

And then added the following to my virtualhost definition in /etc/apache2/modules.d/40_mod_ssl.conf:

ProxyRequests Off <Proxy *> Order deny,allow Allow from all </Proxy> ProxyPass /ajaxterm/ http://localhost:8080/ ProxyPassReverse /ajaxterm/ http://localhost:8080/

Restart Apache (apache2ctl stop && apache2ctl startssl) and then I could connect from another host to https://metis/ajaxterm/ and get a terminal session going:

Ajaxterm demo

That’s a screenshot of the terminal running in my browser. It’s really slow in responding, but it does indeed work.

My only complaint iis that it doesn’t actually give you a login when you connect. It just runs the ssh command specified. So although I could change the user with ’ssh user@localhost’, I don’t see any easy way to get Ajaxterm to support multiple users.

Interesting proof of concept though.

4 Responses to “Ajaxterm web based terminal”

  1. Antony Says:

    Run it as root, it will launch /bin/login instead of ssh localhost

    -c option to run something else

    Click on GET to use GET instead of POST, faster but keypress might be logged

  2. John Says:

    I’m sure it’s fine, but running a Python script that can run system commands as root makes me awfully nervous…

  3. antony Says:

    Then you could try -c ’sudo /bin/login’

  4. kfm82 Says:

    Does the process for integrating the proxy module work the same for Apache 1.3.x?
    Also, I would love to read about some more detailed httpd.conf setups, integrating https/SSL and such.

Leave a Reply