chroot
also: chroot jail
A system call and command that changes the root directory (/) for a process and its children to a new location, isolating them in a restricted filesystem subtree.
chroot changes what a process sees as the root of the filesystem. Instead of / pointing to the system root, it points to a directory you specify. This creates a confined environment where processes cannot access files outside that directory.
For example, you might create a jailed environment at /var/jail containing minimal system files. Running chroot /var/jail /bin/bash starts a shell that treats /var/jail as its root—/etc now refers to /var/jail/etc, and files above /var/jail are invisible to that shell.
chroot is commonly used for system administration (upgrading systems, creating minimal containers), security sandboxing, and testing software in isolated environments. However, it's not a complete security boundary—processes running as root can escape a chroot jail.