The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Running a queued set of commands? jjinno Shell Programming and Scripting 1 04-25-2008 03:27 AM
Running UNIX Commands from C zainab High Level Programming 2 04-14-2008 11:35 PM
Running services, how to disable some? empty UNIX for Dummies Questions & Answers 2 03-19-2008 07:33 PM
running commands from outside of bash rakabarp Shell Programming and Scripting 3 03-13-2008 06:40 AM
running commands from script owijust Shell Programming and Scripting 2 01-09-2006 06:12 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-14-2006
Umesh_Sharoff Umesh_Sharoff is offline
Registered User
  
 

Join Date: Jun 2002
Location: Bangalore
Posts: 3
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
  #2 (permalink)  
Old 07-14-2006
jim mcnamara jim mcnamara is online now Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
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:
http://www.onlamp.com/pub/a/bsd/2003/01/23/chroot.html
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0