Article View: comp.editors
Article #9Re: Vi help needed
From: Larry W. Virden
Date: Wed, 28 Oct 1992 11:46
Date: Wed, 28 Oct 1992 11:46
79 lines
3930 bytes
3930 bytes
In article <719168508snx@n5ial.chi.il.us> jim@n5ial.chi.il.us (Jim Graham) writes: :In article <"16177.Thu.Oct.8.06 nickp@BNR.CA writes: : :> from vi to> Unix, so we currently have an .exrc file (owner=root, :> group=root, perms=644) in> the user's home directory which maps CTRL-C & :> CTRL-Z to ESC and sets 'shell' to> 'NOSHELL'. However, we've found that :> the knowledgeable user can still shell out> by resetting shell to :> /bin/sh or similar. : :I won't ask why you would want to prevent users from shelling out, but :I realize that there are some companies (I used to work for one) who are :really paranoid about these things, so I won't touch that one..... Here is a real-life example of why someone may want to do this. A site I know allows 'guests' to receive and send email - but that is all that they are allowed to do. The site wants to provide the user with some sort of editor access rather than just a 'kill the msg and start over if you make a mistake'. So vi is wanted. But access to other files, etc. is NOT to be allowed. This is an attempt to provide security that security audits will approve, so that various contract work can continue and that site can continue to be paid on a monthly basis. : :but I do have an idea for you. it's very simple, really. you simply :execute the following commands: : % su : # cd /bin : # rm -f sh csh ksh tcsh [any other shells] Not too practical unless no one else is going to use the machine, including cron, etc. : : % su : # cd /bin : # rm -f csh ksh tcsh [any other shells] : # chown root sh : # chmod 700 sh : This also is not too practical for the same reason. :also, guess what.... since the user owns their $HOME directory, they :can still rm the .exrc file you've created with a simple rm -f, so :that doesn't do *ANYTHING* for you (consider: :!rm -f $HOME/.exrc). Well, now you made an assumption here. You assumed that the user owns their HOME directory. But in fact, in this type of setup, all someone has to do is set $HOME owned by root, with read and exec access given. Then the .exrc is protected, as is .profile, etc. :and there's always the simple fact that they can use :!/bin/sh to shell :out. and you can't exactly take all of that away, since that's how you :access the fmt command.... Well, one COULD eliminate it with access to the source. For instance, use a home grown version of system which forces use of /bin/restricted_shell or whatever it is called on one's system. Don't permit calls to /bin/sh or any of the other shells if this is a restricted vi call. Don't even let vi use :e , :r and :w in the restricted mode - prevents one from reading or writing files they shouldn't. Etc. : :of course, if this is for a UNIX-based BBS system, why do you care if :they have access to vi at all? what could they possibly need it for? :if they need an editor for something, just give them simped or :something similar, and rm vi from the system (or at least, from general :access). Well, simped is a possibility, but since more folk know how to use vi than simped, it seems more useful to provide vi, or at least a vi look alike. -- Larry W. Virden UUCP: osu-cis!chemabs!lvirden Same Mbox: BITNET: lvirden@cas INET: lvirden@cas.org Personal: 674 Falls Place, Reynoldsburg, OH 43068-1614 America Online: lvirden@aol.com
Technical Details
Message-ID:
<1992Oct28.115404.20844@cas.org>Path:
arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!chemabs!lwv26References:
<"16177.Thu.Oct.8.06 <719168508snx@n5ial.chi.il.us>Show Full Headers
Complete Article Headers
Newsgroups: comp.editors Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!malgudi.oar.net!chemabs!lwv26 From: lwv26@cas.org (Larry W. Virden) Subject: Re: Vi help needed Message-ID: <1992Oct28.115404.20844@cas.org> Followup-To: comp.editors Sender: usenet@cas.org Reply-To: lvirden@cas.org (Larry W. Virden) Organization: Nedriv Software and Shoe Shiners, Uninc. References: <"16177.Thu.Oct.8.06 <719168508snx@n5ial.chi.il.us> Date: Wed, 28 Oct 1992 11:46:38 GMT Lines: 79