2 .\" Copyright 1989 AT&T Copyright (c) 1993, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH RSH 8 "Nov 1, 1993"
8 rsh, restricted_shell \- restricted shell command interpreter
12 \fB/usr/lib/rsh\fR [\fB-acefhiknprstuvx\fR] [\fIargument\fR]...
17 \fBrsh\fR is a limiting version of the standard command interpreter \fBsh\fR,
18 used to restrict logins to execution environments whose capabilities are more
19 controlled than those of \fBsh\fR (see \fBsh\fR(1) for complete description and
23 When the shell is invoked, it scans the environment for the value of the
24 environmental variable, \fBSHELL\fR. If it is found and \fBrsh\fR is the file
25 name part of its value, the shell becomes a restricted shell.
28 The actions of \fBrsh\fR are identical to those of \fBsh\fR, except that the
29 following are disallowed:
34 changing directory (see \fBcd\fR(1)),
40 setting the value of $\fBPATH\fR,
46 specifying path or command names containing \fB/\fR,
52 redirecting output (\fB>\fR and \fB>>\fR).
56 The restrictions above are enforced after \fI\&.profile\fR is interpreted.
59 A restricted shell can be invoked in one of the following ways:
63 \fBrsh\fR is the file name part of the last entry in the \fB/etc/passwd\fR
64 file (see \fBpasswd\fR(4));
69 the environment variable \fBSHELL\fR exists and \fBrsh\fR is the file name
70 part of its value; the environment variable \fBSHELL\fR needs to be set in the
76 the shell is invoked and \fBrsh\fR is the file name part of argument 0;
81 the shell is invoked with the \fB-r\fR option.
85 When a command to be executed is found to be a shell procedure, \fBrsh\fR
86 invokes \fBsh\fR to execute it. Thus, it is possible to provide to the end-user
87 shell procedures that have access to the full power of the standard shell,
88 while imposing a limited menu of commands; this scheme assumes that the
89 end-user does not have write and execute permissions in the same directory.
92 The net effect of these rules is that the writer of the \fI\&.profile\fR (see
93 \fBprofile\fR(4)) has complete control over user actions by performing
94 guaranteed setup actions and leaving the user in an appropriate directory
95 (probably \fInot\fR the login directory).
98 The system administrator often sets up a directory of commands (that is,
99 \fB/usr/rbin\fR) that can be safely invoked by a restricted shell. Some systems
100 also provide a restricted editor, \fBred\fR.
103 Errors detected by the shell, such as syntax errors, cause the shell to return
104 a non-zero exit status. If the shell is being used non-interactively execution
105 of the shell file is abandoned. Otherwise, the shell returns the exit status of
106 the last command executed.
109 \fBIntro\fR(1), \fBcd\fR(1), \fBlogin\fR(1), \fBrsh\fR(1), \fBsh\fR(1),
110 \fBexec\fR(2), \fBpasswd\fR(4), \fBprofile\fR(4), \fBattributes\fR(5)
113 The restricted shell, \fB/usr/lib/rsh\fR, should not be confused with the
114 remote shell, \fB/usr/bin/rsh\fR, which is documented in \fBrsh\fR(1).