8980 BIOS clock is sometimes one hour fast
[unleashed.git] / usr / src / man / man1m / rsh.1m
blob85696ba0f4981087236237c434ad7bfe4e9a82e7
1 '\" te
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 1M "Nov 1, 1993"
7 .SH NAME
8 rsh, restricted_shell \- restricted shell command interpreter
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/lib/rsh\fR [\fB-acefhiknprstuvx\fR] [\fIargument\fR]...
13 .fi
15 .SH DESCRIPTION
16 .LP
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
20 usage).
21 .sp
22 .LP
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.
26 .sp
27 .LP
28 The actions of \fBrsh\fR are identical to those of \fBsh\fR, except that the
29 following are disallowed:
30 .RS +4
31 .TP
32 .ie t \(bu
33 .el o
34 changing directory (see \fBcd\fR(1)),
35 .RE
36 .RS +4
37 .TP
38 .ie t \(bu
39 .el o
40 setting the value of $\fBPATH\fR,
41 .RE
42 .RS +4
43 .TP
44 .ie t \(bu
45 .el o
46 specifying path or command names containing \fB/\fR,
47 .RE
48 .RS +4
49 .TP
50 .ie t \(bu
51 .el o
52 redirecting output (\fB>\fR and \fB>>\fR).
53 .RE
54 .sp
55 .LP
56 The restrictions above are enforced after \fI\&.profile\fR is interpreted.
57 .sp
58 .LP
59 A restricted shell can be invoked in one of the following ways:
60 .RS +4
61 .TP
63 \fBrsh\fR is the file name part of the last entry in the \fB/etc/passwd\fR
64 file (see \fBpasswd\fR(4));
65 .RE
66 .RS +4
67 .TP
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
71 \fB\&.login\fR file;
72 .RE
73 .RS +4
74 .TP
76 the shell is invoked and \fBrsh\fR is the file name part of argument 0;
77 .RE
78 .RS +4
79 .TP
81 the shell is invoked with the \fB-r\fR option.
82 .RE
83 .sp
84 .LP
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.
90 .sp
91 .LP
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).
96 .sp
97 .LP
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.
101 .SH EXIT STATUS
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.
107 .SH SEE ALSO
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)
111 .SH NOTES
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).