Some versions of vi have a "safe" mode that doesn't allow shell escapes and the like (-S flag for nvi). Alternately, you can use the noexec program: http://noexec.sourceforge.net/ This functionality will be in the next version of sudo (and is already present in the cvs version). - todd