Here's how to stop shell escapes from vi
Brad Templeton
brad at looking.on.ca
Fri Sep 21 14:01:06 AEST 1990
Pretty drastic to forbid certain characters like :! in vi.
I once set up my system with a special subdirectory that had a mini
root filesystem on it.
I then created a login shell that chroot'd the users into that directory
and started up their shell there.
They can play there all they want, and it is safe. As long as you keep
permissions clean on the main subdirectories (ie. don't leave /etc and
/dev and its important files unprotected) you are fine. You link in
the files and binaries you want to give them.
There are a few problems, of course:
a) Unless you have symlinks, you can't link in files that are on a
different filesystem. In general, you either want to create this mini
system on the root FS (so you can link in stuff from /bin and /usr) or
you have to waste a lot of disk space copying those binaries.
b) Users can't change their passwords, unless you make some special
program that looks at their fake password file and copies up passwords,
which is risky.
c) Unless the news spool happens to be inside the protected subtree, as
well as the news library, users can't read news. *but*, you can run
NNTP on the machine, the server running in the real world and the client
in the protected world.
Chroot plus symlinks would create the perfect secure mini-environment.
You are fully protected unless the pesky users can figure out how to
become root. Most tricks for doing this involve greek horses or fiddling
with files used by suid programs. But this rarely works if all you have
access to is the subdir.
--
Brad Templeton, ClariNet Communications Corp. -- Waterloo, Ontario 519/884-7473
More information about the Comp.unix.sysv386
mailing list