What Is a Chroot?

Article Details
  • Written By: Mary McMahon
  • Edited By: Shereen Skola
  • Last Modified Date: 17 October 2019
  • Copyright Protected:
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
In 2019, a winery in Moldova hosted a 10-km race in the world's largest wine cellar, which holds 2 million bottles.  more...

November 19 ,  1863 :  The Gettysburg Address speech was delivered.  more...

A chroot is an isolated area in a computer system where users can test untrusted programs and engage in other operations that they do not want to affect the rest of the computer. It is used in Unix and similar systems, and requires the user to execute a series of commands that change the root directory used as a reference by the program. The chroot command needs to be used cautiously because the system can still be vulnerable if it is not set up properly, or if the user fails to exercise care when operating inside it.

When a user creates a chroot environment, the programs run within that environment treat the specified directory as the root. These programs assume that there are no higher directories, and thus cannot access the true root directory at the top of the file system. This makes it difficult to make modifications that could endanger the rest of the system. Other programs cannot access and modify the information within the chroot, either; it acts like an isolation unit.


Chroot can be broken, using a variety of techniques. One of the most basic involves leaving the user in the chroot with root privileges, which allow for widespread modifications to the system. Programs can take advantage of this to break out of their digital jail and access the rest of the system. For this reason, it is important to change the user permissions as soon as possible, a standard measure in computer security. Leaving users set to the least privileged roles as a general rule can reduce the risk of a safety problem.

The false root directory also needs to be appropriately populated with resources programs need to use. If it is not, they may not run correctly. Users typically keep anything not strictly necessary out of the chroot, but do need to make sure some information is available. As users navigate in the environment, they can take note of any specific issues or concerns that arise so they’re aware before they try the same processes in the computer system at large.

This can be a useful testing environment, where a user wants to explore code or programs with a reduced risk to the rest of the system. It can also be valuable for handling unknown or untrusted materials. Rather than loading these on the system directly, the user can use chroot to examine and evaluate them to determine if they are safe.


You might also Like


Discuss this Article

Post your comments

Post Anonymously


forgot password?