rbash

Restricted Bash shell, equivalent to bash --restricted. Does not permit changing the working directory, redirecting command output, or modifying environment variables, among other things. See also histexpand for history expansion. More information: <https://www.gnu.org/software/bash/manual/html_node/The-Restricted-Shell>.

Install

All systems
curl cmd.cat/rbash.sh
Debian Debian
apt-get install bash
Ubuntu
apt-get install bash
Alpine
apk add bash
Arch Arch Linux
pacman -S bash
image/svg+xml Kali Linux
apt-get install bash
CentOS
yum install bash
Fedora
dnf install bash
Windows (WSL2)
sudo apt-get update sudo apt-get install bash
OS X
brew install bash
Raspbian
apt-get install bash
Docker
docker run cmd.cat/rbash rbash powered by Commando

Restricted Bash shell, equivalent to bash --restricted. Does not permit changing the working directory, redirecting command output, or modifying environment variables, among other things. See also histexpand for history expansion. More information: <https://www.gnu.org/software/bash/manual/html_node/The-Restricted-Shell>.

  • Start an interactive shell session:
    rbash
  • Execute a command and then exit:
    rbash -c "command"
  • Execute a script:
    rbash path/to/script.sh
  • Execute a script, printing each command before executing it:
    rbash -x path/to/script.sh
  • Execute commands from a script, stopping at the first error:
    rbash -e path/to/script.sh
  • Read and execute commands from `stdin`:
    rbash -s

© tl;dr; authors and contributors