293 useradd/del/mod should be ZFS-aware
[illumos-gate.git] / usr / src / man / man1m / rsh.1m
blob025f371aec3f1a0774c396451bb69a3d7072a319
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 .sp
17 .LP
18 \fBrsh\fR is a limiting version of the standard command interpreter \fBsh\fR,
19 used to restrict logins to execution environments whose capabilities are more
20 controlled than those of \fBsh\fR (see \fBsh\fR(1) for complete description and
21 usage).
22 .sp
23 .LP
24 When the shell is invoked, it scans the environment for the value of the
25 environmental variable, \fBSHELL\fR. If it is found and \fBrsh\fR is the file
26 name part of its value, the shell becomes a restricted shell.
27 .sp
28 .LP
29 The actions of \fBrsh\fR are identical to those of \fBsh\fR, except that the
30 following are disallowed:
31 .RS +4
32 .TP
33 .ie t \(bu
34 .el o
35 changing directory (see \fBcd\fR(1)),
36 .RE
37 .RS +4
38 .TP
39 .ie t \(bu
40 .el o
41 setting the value of $\fBPATH\fR,
42 .RE
43 .RS +4
44 .TP
45 .ie t \(bu
46 .el o
47 pecifying path or command names containing \fB/\fR,
48 .RE
49 .RS +4
50 .TP
51 .ie t \(bu
52 .el o
53 redirecting output (\fB>\fR and \fB>>\fR).
54 .RE
55 .sp
56 .LP
57 The restrictions above are enforced after \fI\&.profile\fR is interpreted.
58 .sp
59 .LP
60 A restricted shell can be invoked in one of the following ways:
61 .RS +4
62 .TP
64 \fBrsh\fR is the file name part of the last entry in the \fB/etc/passwd\fR
65 file (see \fBpasswd\fR(4));
66 .RE
67 .RS +4
68 .TP
70 the environment variable \fBSHELL\fR exists and \fBrsh\fR is the file name
71 part of its value; the environment variable \fBSHELL\fR needs to be set in the
72 \fB\&.login\fR file;
73 .RE
74 .RS +4
75 .TP
77 the shell is invoked and \fBrsh\fR is the file name part of argument 0;
78 .RE
79 .RS +4
80 .TP
82 the shell is invoke with the \fB-r\fR option.
83 .RE
84 .sp
85 .LP
86 When a command to be executed is found to be a shell procedure, \fBrsh\fR
87 invokes \fBsh\fR to execute it. Thus, it is possible to provide to the end-user
88 shell procedures  that have access to the full power of the standard shell,
89 while imposing a limited menu of commands; this scheme assumes that the
90 end-user does not have write and execute permissions in the same directory.
91 .sp
92 .LP
93 The net effect of these rules is that the writer of the \fI\&.profile\fR (see
94 \fBprofile\fR(4)) has complete control over user actions by performing
95 guaranteed setup actions and leaving the user in an appropriate directory
96 (probably \fInot\fR the login directory).
97 .sp
98 .LP
99 The system administrator often sets up a directory of commands (that is,
100 \fB/usr/rbin\fR) that can be safely invoked by a restricted shell. Some systems
101 also provide a restricted editor, \fBred\fR.
102 .SH EXIT STATUS
105 Errors detected by the shell, such as syntax errors, cause the shell to return
106 a non-zero exit status. If the shell is being used non-interactively execution
107 of the shell file is abandoned. Otherwise, the shell returns the exit status of
108 the last command executed.
109 .SH SEE ALSO
112 \fBintro\fR(1), \fBcd\fR(1), \fBlogin\fR(1), \fBrsh\fR(1), \fBsh\fR(1), \fB
113 exec\fR(2), \fBpasswd\fR(4), \fBprofile\fR(4), \fBattributes\fR(5)
114 .SH NOTES
117 The restricted shell, \fB/usr/lib/rsh\fR, should not be confused with the
118 remote shell, \fB/usr/bin/rsh\fR, which is documented in \fBrsh\fR(1).