i-bash/RBASH

38 lines
1.7 KiB
Text
Raw Normal View History

2005-12-07 14:08:12 +00:00
6.10 The Restricted Shell
=========================
2002-07-17 14:10:11 +00:00
If Bash is started with the name 'rbash', or the '--restricted' or '-r'
2002-07-17 14:10:11 +00:00
option is supplied at invocation, the shell becomes restricted. A
restricted shell is used to set up an environment more controlled than
the standard shell. A restricted shell behaves identically to 'bash'
2002-07-17 14:10:11 +00:00
with the exception that the following are disallowed or not performed:
* Changing directories with the 'cd' builtin.
* Setting or unsetting the values of the 'SHELL', 'PATH', 'ENV', or
'BASH_ENV' variables.
2002-07-17 14:10:11 +00:00
* Specifying command names containing slashes.
* Specifying a filename containing a slash as an argument to the '.'
2002-07-17 14:10:11 +00:00
builtin command.
* Specifying a filename containing a slash as an argument to the '-p'
option to the 'hash' builtin command.
2002-07-17 14:10:11 +00:00
* Importing function definitions from the shell environment at
startup.
* Parsing the value of 'SHELLOPTS' from the shell environment at
2002-07-17 14:10:11 +00:00
startup.
* Redirecting output using the '>', '>|', '<>', '>&', '&>', and '>>'
2002-07-17 14:10:11 +00:00
redirection operators.
* Using the 'exec' builtin to replace the shell with another command.
* Adding or deleting builtin commands with the '-f' and '-d' options
to the 'enable' builtin.
* Using the 'enable' builtin command to enable disabled shell
2002-07-17 14:10:11 +00:00
builtins.
* Specifying the '-p' option to the 'command' builtin.
* Turning off restricted mode with 'set +r' or 'set +o restricted'.
2002-07-17 14:10:11 +00:00
These restrictions are enforced after any startup files are read.
When a command that is found to be a shell script is executed (*note
Shell Scripts::), 'rbash' turns off any restrictions in the shell
2002-07-17 14:10:11 +00:00
spawned to execute the script.