1rsh(1M) System Administration Commands rsh(1M)
2
3
4
6 rsh, restricted_shell - restricted shell command interpreter
7
9 /usr/lib/rsh [-acefhiknprstuvx] [argument]...
10
11
13 rsh is a limiting version of the standard command interpreter sh, used
14 to restrict logins to execution environments whose capabilities are
15 more controlled than those of sh (see sh(1) for complete description
16 and usage).
17
18
19 When the shell is invoked, it scans the environment for the value of
20 the environmental variable, SHELL. If it is found and rsh is the file
21 name part of its value, the shell becomes a restricted shell.
22
23
24 The actions of rsh are identical to those of sh, except that the fol‐
25 lowing are disallowed:
26
27 o changing directory (see cd(1)),
28
29 o setting the value of $PATH,
30
31 o pecifying path or command names containing /,
32
33 o redirecting output (> and >>).
34
35
36 The restrictions above are enforced after .profile is interpreted.
37
38
39 A restricted shell can be invoked in one of the following ways:
40
41 1. rsh is the file name part of the last entry in the
42 /etc/passwd file (see passwd(4));
43
44 2. the environment variable SHELL exists and rsh is the file
45 name part of its value; the environment variable SHELL needs
46 to be set in the .login file;
47
48 3. the shell is invoked and rsh is the file name part of argu‐
49 ment 0;
50
51 4. the shell is invoke with the -r option.
52
53
54 When a command to be executed is found to be a shell procedure, rsh
55 invokes sh to execute it. Thus, it is possible to provide to the end-
56 user shell procedures that have access to the full power of the stan‐
57 dard shell, while imposing a limited menu of commands; this scheme
58 assumes that the end-user does not have write and execute permissions
59 in the same directory.
60
61
62 The net effect of these rules is that the writer of the .profile (see
63 profile(4)) has complete control over user actions by performing guar‐
64 anteed setup actions and leaving the user in an appropriate directory
65 (probably not the login directory).
66
67
68 The system administrator often sets up a directory of commands (that
69 is, /usr/rbin) that can be safely invoked by a restricted shell. Some
70 systems also provide a restricted editor, red.
71
73 Errors detected by the shell, such as syntax errors, cause the shell to
74 return a non-zero exit status. If the shell is being used non-interac‐
75 tively execution of the shell file is abandoned. Otherwise, the shell
76 returns the exit status of the last command executed.
77
79 See attributes(5) for descriptions of the following attributes:
80
81
82
83
84 ┌─────────────────────────────┬─────────────────────────────┐
85 │ ATTRIBUTE TYPE │ ATTRIBUTE VALUE │
86 ├─────────────────────────────┼─────────────────────────────┤
87 │Availability │SUNWcsu │
88 └─────────────────────────────┴─────────────────────────────┘
89
91 intro(1), cd(1), login(1), rsh(1), sh(1), exec(2), passwd(4), pro‐
92 file(4), attributes(5)
93
95 The restricted shell, /usr/lib/rsh, should not be confused with the
96 remote shell, /usr/bin/rsh, which is documented in rsh(1).
97
98
99
100SunOS 5.11 1 Nov 1993 rsh(1M)