Restricted shell (was Re: rsh environment)

Leo de Wit leo at philmds.UUCP
Sun Dec 25 22:34:39 AEST 1988


In article <14640 at cisunx.UUCP> jcbst3 at unix.cis.pittsburgh.edu (James C. Benz) writes:
|In article <1276 at uwbull.uwbln.UUCP> ckl at uwbln.UUCP (Christoph Kuenkel) writes:
|>Is there any way to alter the default environment setting used when
|>rsh (the bsd remote shell) executes commands?
|>
|>our rsh (bull sps9 with spix os) sets up an default environment
|>
|HUH?  (cr,h,...)ackers anyone?  Isn't rsh RESTRICTED shell?  Anyway,
|why not just set these in .profile using standard UNIX syntax ala
|HOME=/usr/mydirectory;export HOME
|That is, if you have permissions on .profile.
|Or is YOUR UNIX *different* than mine (AT&T)?

Definitely. The guy said bsd. 'rsh' was also a surprise to me when I
first worked in a System V environment.

The BSD /bin/sh has also a notion of restriction, although I never saw
it documented (not in sh(1) nor in S. R. Bourne's 'An Introduction to
the UNIX Shell').

The following is run on an Vax running Ultrix:

Script started on Sun Dec 25 13:15:02 1988
philmds> sh
philmds> set -r
philmds> pwd
/usr/leo
philmds> cd ..
cd: restricted
philmds> cd /
cd: restricted
philmds> cd News
cd: restricted
philmds> ls bin
   [my bin directory is listed]...
philmds> /bin/ls bin
/bin/ls: restricted
philmds> ^Dphilmds> 

script done on Sun Dec 25 13:17:20 1988

Restriction seems to imply both not to be able to change the working
directory and execute only commands that are found using $PATH (they
may not contain a slash).

I'm interested both in what restriction means in System V, and whether
there is any documentation about -r (set -r, sh -r) for the BSD /bin/sh.
Furthermore I'm interested in hearing about its use (for what, and how).

        Leo.



More information about the Comp.unix.wizards mailing list