|
Next
Previous
Contents
2. Preparing the Jail2.1 Creating a UserAs mentioned in the introduction, it's not a good idea to run BIND as root. So,
before we begin, let's create a separate user for BIND. Note that you should
never use an existing generic user like This requires adding a line something like the following to
And one like this to /etc/group:
This creates a user and group called named for BIND. Make sure that the
UID and GID (both 200 in this example) are unique on your system. The shell is
set to /bin/false because this user will never need to log in.
2.2 Directory StructureNow, we must set up the directory structure that we will use for the chroot jail
in which BIND will live. This can be anywhere on your filesystem; the truly
paranoid may even want to put it on a separate volume. I shall assume that you
will use
2.3 Placing the BIND DataAssuming that you have already done a conventional installation of BIND and are
using it, you will already have an existing
BIND will likely need to write to the
BIND will also need to write to the /var/run directory, to put its
pidfile and ndc socket there, so let's allow it to do so:
2.4 System Support FilesOnce BIND is running in the chroot jail, it will not be able to access files outside the jail at all. However, it needs to access a few key files, such as the system's C library. Exactly what libraries are required will depend on your flavour of UNIX. For most modern Linux systems, the following commands will be sufficient to put the necessary libraries in place:
As an alternative, you could simply build statically-linked versions of the BIND
binaries to put in your chroot jail. You should also copy ldconfig into
the jail, and run it to create an etc/ld.so.cache for the jail environment.
The following commands could take care of this:
BIND needs one more system file in its jail: good ol'
Finally, you need a couple extra files in the
Keep in mind that the GID, 200 in this example, must match the one you defined
in the real
2.5 LoggingUnlike a conventional jailbird, BIND can't just scribble its log entries on the
walls :-). Normally, BIND logs through
The Ideal SolutionThe ideal solution to this dilemma requires a reasonably recent version of
If you do, all you have to do is add the switch ``
to
On Caldera OpenLinux systems, they use a daemon launcher called
Similarly, on SuSE systems, I'm told that the best place to add this switch
is in the
to read
should do the trick.
Once you've figured out how to make this change for your system, simply
restart
Once it's been restarted, you should see a ``file'' in
srw-rw-rw- 1 root root 0 Mar 13 20:58 log
The Other SolutionsIf you have an older Alteratively, you can simply configure BIND to log to files instead of going through syslog. See the BIND documentation for more details if you choose to go this route.
Next Previous Contents Linux HOWTO full list |
|
This document, LDP HOWTO-INDEX, is copyrighted (c) 1995 - 2002 by Tim Bynum, Guylhem Aznar, Joshua Drake and Greg Ferguson. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at http://www.gnu.org/copyleft/fdl.html. If you have questions, please contact the LDP.
Web Design Copyright © 1999-2003. Chrisranjana Software Solutions Pvt Ltd. syndicate rss feed |