I recently read an article about AjaxTerm in the German Linux Magazin. It is a AJAX-based SSH client which runs in your browser. So with the respective setup you are able to access your box’ shell from anywhere just with a browser. You do not even have any problems with firewalls and proxies anymore!
This is a small guide which explains how to setup AjaxTerm on a Debian System with Plesk:
1. Go to the AjaxTerm Website and download the latest release (currently 0.10).
# wget http://antony.lesuisse.org/qweb/files/Ajaxterm-0.10.tar.gz
2. Extract the archive, become root, move the folder to /usr/local/ and create a symlink for easier access.
# tar xvzf Ajaxterm-0.10.tar.gz
# su
# mv Ajaxterm/ /usr/local
# ln -s /usr/local/Ajaxterm-0.10 /usr/local/ajaxterm
# cd /usr/local/ajaxterm
3. Copy the Debian init script for AjaxTerm to /etc/init.d/ and add it to all default run levels
# cp configure.initd.debian /etc/init.d/ajaxterm
# update-rc.d ajaxterm defaults
4. Edit the init script and change the variable DAEMON to /usr/local/ajaxterm/ajaxterm.py and PORT to 8022. Check that the executable name is ajaxterm.py (with the file extension!).
5. Make the init script executable and start AjaxTerm
# chmod a+x /etc/init.d/ajaxterm
# /etc/init.d/ajaxterm start
Starting ajaxterm on port 8022
AjaxTerm at http://localhost:8022/ pid: 7580
AjaxTerm is now successfully running (it started ssh session on localhost with user nobody) but is only listening on localhost:8022. Therefore we will use the Apache proxy module to access AjaxTerm using a subdomain. (As we did in the Plesk on Port 443 Howto)
6. Create a new subdomain with PHP support in Plesk, e.g. ajaxterm.example.com.
7. Go to the conf directory of the new domain.
# cd /var/www/vhosts/example.com/subdomains/ajaxterm/conf
8. Create a new vhost.conf with the following lines.
ProxyRequests Off
<proxy *>
Order deny,allow
Allow from all
</proxy>
ProxyPass /ajaxterm/ http://localhost:8022/
ProxyPassReverse /ajaxterm/ http://localhost:8022/
9. Activate the proxy Apache module, reconfigure Plesk so that it finds the new vhost.conf and reload the apache configuration.
# a2enmod proxy
# /usr/local/psa/admin/sbin/websrvmng --reconfigure-vhost --vhost-name=example.com
# /etc/init.d/apache reload
You should not get any errors!
10. Access AjaxTerm: https://ajaxterm.example.com/ajaxterm/ (Don’t forget the trailing slash!)
11. Because we do not want to be able to use AjaxTerm over unsecured HTTP, we create a simple index.php in httpdoc/ and httpsdoc/ of the subdomain folder, which will redirect to the above link. Furthermore you should delete the index.html file in httpdocs/ and httpsdocs/.
< ? header("Location: https://" . $_SERVER['SERVER_NAME'] . "/ajaxterm/"); ?>
Now you should be able to access AjaxTerm by visiting https://ajaxterm.example.com with your browser.
If you are really paranoid you should secure the access furthermore by setting up an authentication, e.g. basic http authentication.
