Shell - Drupal 6 Module

Note!  This project is now an official Drupal project.  You may download it by going here:

shell-screenshot.jpgAre you using an inexpensive (or just plain limited) web host, and don't have access to a proper shell?  You know if only you could pull up putty, you could perform some operation in half the time it will take you in cpanel or some FTP client.  If this sounds familiar, then you should check out my latest Drupal 6 module, Shell.

Shell is a web-based Ajaxy pseudo shell which gives you most of the commands of your linux/unix server.  This will not work for Windows servers.  It works by passing whatever you type through PHP and directly to the server, then shows you the response.  If you are comfortable using putty (or any other shell) then you will feel right at home with this module.  It even gives you a tab-autocomplete like a real shell.


  • Most Unix/Linux commands are available and work as expected.  However, programs which require user interaction (like vi, emacs, less, man, etc) will not work currectly.  Luckily:
  • There is built-in support for file viewing and edititng to make up for the lack of vi, emacs, less, and man working.  So, you will be able to edit and view files.
  • Works in PHP Safe Mode.
  • Features a tab-autocomplete.
  • Can be loaded into a popup (or many popups)


  • Unpack the module files into /sites/all/modules/shell.
  • Visit your admin/build/modules page in Drupal and enable the module.
  • Visit your admin/user/permissions and give authorized users the "execute shell commands" permission, if desired.  (Otherwise, only the admin user will be able to use it).
  • Visit to access the shell.


Anyone using this module will have full control over your web site and possibly the entire server.  They will be able to delete anything they wish, install anything they wish, etc.  Naturally, this is a major security concern.  You should only let users you absolutely trust have permission to use Shell.  As stated above, if you do not configure any permissions, then admin will be the only user who can access it.  This is probably the desired case.

This is not Drush!

You may be thinking this sounds a little bit like Drush, which stands for "Drupal Shell."  Drush is an excellent module, which lets you configure much of your drupal site from the command line.  But, unless you are able to access your site via a shell in the first place, you will not be able to install or use Drush.  Drush lets you configure parts of your drupal site, where my module lets you run any available command or program on your server.  In fact, you can use my module to run Drush!


This project was inspired by the phpterm project by bzrundi, located here: