| 1 |
.lf 1 ./rbash.1 |
| 2 |
.TH RBASH 1 "2021 November 22" "Bash-5.2" |
| 3 |
.SH NAME |
| 4 |
rbash \- restricted bash, see \fBbash\fR(1) |
| 5 |
.SH RESTRICTED SHELL |
| 6 |
.nr zY 1 |
| 7 |
.lf 1 ./bash.1 |
| 8 |
.\" |
| 9 |
.\" MAN PAGE COMMENTS to |
| 10 |
.\" |
| 11 |
.\" Chet Ramey |
| 12 |
.\" Case Western Reserve University |
| 13 |
.\" [email protected] |
| 14 |
.\" |
| 15 |
.\" Last Change: Mon Apr 7 16:59:13 EDT 2025 |
| 16 |
.\" |
| 17 |
.\" For bash_builtins, strip all but "SHELL BUILTIN COMMANDS" section |
| 18 |
.\" For rbash, strip all but "RESTRICTED SHELL" section |
| 19 |
.\" |
| 20 |
.\" Both conditionalize text based on the base page being formatted |
| 21 |
.\" using the zZ and zY registers, respectively |
| 22 |
.\" |
| 23 |
.\" Ensure the registers are initialized to avoid groff warnings. |
| 24 |
.nr zZ +0 |
| 25 |
.nr zY +0 |
| 26 |
.\" Ensure the macros/strings are initialized to avoid groff warnings. |
| 27 |
.ds zZ \" empty |
| 28 |
.ds zY \" empty |
| 29 |
.if \n(zZ=1 .ig zZ |
| 30 |
.PP |
| 31 |
If |
| 32 |
.B bash |
| 33 |
is started with the name |
| 34 |
.BR rbash , |
| 35 |
or the |
| 36 |
.B \-r |
| 37 |
option is supplied at invocation, the shell becomes \fIrestricted\fP. |
| 38 |
A restricted shell is used to |
| 39 |
set up an environment more controlled than the standard shell. |
| 40 |
It behaves identically to |
| 41 |
.B bash |
| 42 |
with the exception that the following are disallowed or not performed: |
| 43 |
.IP \(bu |
| 44 |
Changing directories with \fBcd\fP. |
| 45 |
.IP \(bu |
| 46 |
Setting or unsetting the values of |
| 47 |
.SM |
| 48 |
.BR SHELL , |
| 49 |
.SM |
| 50 |
.BR PATH , |
| 51 |
.SM |
| 52 |
.BR HISTFILE , |
| 53 |
.SM |
| 54 |
.BR ENV , |
| 55 |
or |
| 56 |
.SM |
| 57 |
.BR BASH_ENV . |
| 58 |
.IP \(bu |
| 59 |
Specifying command names containing |
| 60 |
.BR / . |
| 61 |
.IP \(bu |
| 62 |
Specifying a filename containing a |
| 63 |
.B / |
| 64 |
as an argument to the |
| 65 |
.B . |
| 66 |
builtin command. |
| 67 |
.IP \(bu |
| 68 |
Using the \fB\-p\fP option to the |
| 69 |
.B . |
| 70 |
builtin command to specify a search path. |
| 71 |
.IP \(bu |
| 72 |
Specifying a filename containing a slash as an argument to the |
| 73 |
.B history |
| 74 |
builtin command. |
| 75 |
.IP \(bu |
| 76 |
Specifying a filename containing a slash as an argument to the |
| 77 |
.B \-p |
| 78 |
option to the |
| 79 |
.B hash |
| 80 |
builtin command. |
| 81 |
.IP \(bu |
| 82 |
Importing function definitions from the shell environment at startup. |
| 83 |
.IP \(bu |
| 84 |
Parsing the values of |
| 85 |
.SM |
| 86 |
.B BASHOPTS |
| 87 |
and |
| 88 |
.SM |
| 89 |
.B SHELLOPTS |
| 90 |
from the shell environment at startup. |
| 91 |
.IP \(bu |
| 92 |
Redirecting output using the >, >|, <>, >&, &>, and >> redirection operators. |
| 93 |
.IP \(bu |
| 94 |
Using the |
| 95 |
.B exec |
| 96 |
builtin command to replace the shell with another command. |
| 97 |
.IP \(bu |
| 98 |
Adding or deleting builtin commands with the |
| 99 |
.B \-f |
| 100 |
and |
| 101 |
.B \-d |
| 102 |
options to the |
| 103 |
.B enable |
| 104 |
builtin command. |
| 105 |
.IP \(bu |
| 106 |
Using the \fBenable\fP builtin command to enable disabled shell builtins. |
| 107 |
.IP \(bu |
| 108 |
Specifying the |
| 109 |
.B \-p |
| 110 |
option to the |
| 111 |
.B command |
| 112 |
builtin command. |
| 113 |
.IP \(bu |
| 114 |
Turning off restricted mode with |
| 115 |
\fBset +r\fP or \fBshopt \-u restricted_shell\fP. |
| 116 |
.PP |
| 117 |
These restrictions are enforced after any startup files are read. |
| 118 |
.PP |
| 119 |
.ie \n(zY=1 When a command that is found to be a shell script is executed, |
| 120 |
.el \{ When a command that is found to be a shell script is executed |
| 121 |
(see |
| 122 |
.SM |
| 123 |
.B "COMMAND EXECUTION" |
| 124 |
above), |
| 125 |
.\} |
| 126 |
.B rbash |
| 127 |
turns off any restrictions in the shell spawned to execute the |
| 128 |
script. |
| 129 |
.\" end of rbash.1 |
| 130 |
.lf 7 ./rbash.1 |
| 131 |
.SH SEE ALSO |
| 132 |
bash(1) |