Often used for security purposes (but also for convenience in testing and development and sometimes as a way to run older software), chroot establishes a new root ("/") directory for a process. As you can't ever change directories above the root, this effectively establishes a "jail" for the process, isolatiing it entirely from anything above its new root.
All necessary libraries and required files must be present below the new root: you can't just "chroot /usr/xyz" without having setup a proper structure below /usr/xyz. Usually that would not be direct copies of files like /etc/passwd and so on, but modified versions specifically for use here.
Unfortunately, "chroot" has often been broken, allowing processes to escape the jail. Sometimes the exit is as simple as doing another "chroot" command.
Got something to add? Send me email.
More Articles by Tony Lawrence © 2009-11-07 Tony Lawrence
What do such machines really do? They increase the number of things we can do without thinking. Things we do without thinking — there's the real danger. (Frank Herbert)