LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Correlation between CHROOT and Crouton (https://www.linuxquestions.org/questions/linux-newbie-8/correlation-between-chroot-and-crouton-4175496988/)

JoeGatz 03-04-2014 08:52 AM

Correlation between CHROOT and Crouton
 
I am trying to understand what purpose/function of CHROOT and how using it with Crouton will allow you to use certain Linux distros and libs.
Does CHROOT essentially create some kind of a "pseudo-symlink" between the actual root directory and [specified path]?
P.S. If someone could explain this to me like I am "a 3rd grader". I would appreciate it

Soadyheid 03-04-2014 09:15 AM

Chroot allows you to change your root directory. Useful when you're trying to fix a toasted system from a live CD. You can chroot from the live CD's file system into the root directory of the failed systems hard drive. You're then running with the hard drive's filesystem.
Think of it as a stepping stone into the faulty system to allow you to access the files as normal. Gentoo uses chroot to allow you to complete your install after you've built it via a minimal system bootable CD. Does that help? No doubt some one will correct me if I'm wrong.

A crouton, on the other hand, is a cube of toasted bread which is found floating in soup. :D (Sorry, couldn't resist!)

Play Bonny!

:hattip:

salasi 03-04-2014 03:11 PM

I think that the most common use of chroot (not necessarily the only, but most common) is to define a 'false root directory' to contain a process and its accesses to data, so that the process is not allowed to do certain things.

So, imagine an example where some program is accessible to untrusted users and that it is possible that the untrusted user can somehow use the program (or, potentially, something like a shell spawned from the program) to look around the filesystem and maybe even replace files. This is undesirable, because they'll be either seeing data that no one intended to see, or changing files that no one intended them to change and that could have all sorts of implications.

Now you might point out that if you don't want people to have that kind of ability there should be some mechanism in the program that prevents it. The trouble with that argument is that, over the years, many programs have had problems in which someone has figured out some 'corner case' (or bug) in which this strict encapsulation isn't as strict as it should be.

So, how does the the 'false root' system help here? Well, if you have a false root and all the sensitive files are not under the false root, that is an impediment to the evildoer getting at them. Now, it does take some care and it might not be the most secure system (there may be some chance of breaking out of the chroot 'jail' and getting to the main filesystem), but it is another obstacle in the way.

These days, a proper virtual machine might be a more thorough approach (but might have an unacceptable overhead in many circumstances) or a lightweight VM.


All times are GMT -5. The time now is 03:07 PM.