How to disable running commands from vi

Hello,
We have a requirement to disable running shell commands via vi using "!".
Can anybody please suggest how to disable this option.

The requirement arises because we open up a xterm window with a config file in vi mode for the customer to edit. After the customer edits the config file he uses :wq to quit out of it. But he can also get a shell prompt by using "!" and run shell commands. We would like to restrict customers to just editing the config file.

Any ideas on how to accomplish this would be great.

Regards,
Umesh S Sharoff

Some versions of vi support a -S option for safe mode. nvi does this for example.

Is this because you have users running under SUDO? Most vi implementation do not have safe mode (which is not completely safe because users can get around an alias
like alias vi="vi -s"). In this case consider a chroot jail, which is probably the best solution.

example: