Chrooting Devices

Moving daemons and dependencies to a chrooted environment is the first step. The next step is to create devices for the chrooted environment. This is necessary because the /dev directory is not accessible from within the chroot jail. So, all of the devices used by the user or daemon must be created within the jail.

Just as with enumerating files and library dependencies, strace (or truss) can be helpful in stepping through an executable as it executes and noting the devices it tries to access. However, given that strace (or truss) may not show all devices required unless you perform all possible flag permutations exhaustively, using the strings utility on each daemon can also be helpful for enumerating devices. If that does not work, the best recourse is to check various log files for errors and hints related to required devices.

Following is a common list of devices that will likely need to be included:

/dev/null /dev/zero

/dev/random

/dev/conslog

/dev/log

/dev/msglog

/dev/tcp

/dev/ticlts

/dev/ticots

/dev/ticotsord

/dev/udp

To create these devices within the jail, the first step is to find out all of the details about the required devices using the following command:

mail:~ # ls -lL /dev/null crw-rw-rw- 1 root root 1, 3 Jun 30 2004 /dev/null

There are three significant items to note in this output. First, note the first letter in the output. It will either be a b (for "block" device) or c (for "character" device). Second, note the first number in the output after the group membership (in this case a 1). This signifies the "major" number. Third, note the number following the "major" number, which is the "minor" number.

Armed with this information, the chrooted device can now be created within the jail:

Was this article helpful?

0 0
The Ultimate Computer Repair Guide

The Ultimate Computer Repair Guide

Read how to maintain and repair any desktop and laptop computer. This Ebook has articles with photos and videos that show detailed step by step pc repair and maintenance procedures. There are many links to online videos that explain how you can build, maintain, speed up, clean, and repair your computer yourself. Put the money that you were going to pay the PC Tech in your own pocket.

Get My Free Ebook


Post a comment