O'Reilly logo

Getting Started with Cubieboard by Olliver M. Schinagl

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Changing to a special root directory

Normally, the root directory is the main system directory and everything branches from there. Sometimes, we want to restrict access to only certain parts of the system or temporarily pretend a certain directory is this root. The chroot command, which stands for change root, ensures that the supplied directory is considered the new root until exited. As a second parameter, chroot can be told what command to run from within this restricted root. In the following example, the root directory is changed to /tmp/testdir and the requested command to be executed, bash, will reside at /tmp/testdir/bin/bash, as shown here:

packt@PacktPublishing:~$ chroot /tmp/testdir /bin/bash

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required