A simple chroot of bind9.2.3 on FreeBSD5.x[1]

[入库:2005年9月21日] [更新:2007年3月24日]

本文简介:


FreeBSD5.2.1-RELEASE-p8
bind9.2.3 installed by port_replace_base

Notes: It is just a install memo of me but not a text for named. 

[code:1:d452d51f00] 

$ man named

......

OPTIONS

       -t directory
              chroot() to directory after processing the  command  line  argu-
              ments, but before reading the configuration file.

              Warning:;  This  option should be used in conjunction with the -u
              option, as chrooting a process running as root  doesn't  enhance
              security  on  most systems; the way chroot() is defined allows a
              process with root privileges to escape a chroot jail.
......

# ps -ax|grep named
 2611  ??  Ss     0:;00.79 /usr/sbin/named -c /etc/namedb/named.conf -u bind

[/code:1:d452d51f00]

the original bind's working directory in FreeBSD5.x

[code:1:d452d51f00]

working directory:;

/etc/namedb
/var/run/named
/etc
/dev

files options of the original named.conf:;

......

include "/etc/namedb/rndc.key";

controls {
         inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; };
         inet :;:;1 allow { localhost; } keys { "rndc-key"; };
};

options {
         directory "/etc/namedb";
         pid-file "/var/run/named/pid";
         version "Windows 95";
recursion no;
         auth-nxdomain yes;
         listen-on-v6 {
                any;
         };
         dump-file "s/named_dump.db";
};

logging {
        channel bind_log {
                file "/var/log/named/named.log";
                severity info;
         };
        category xfer-out {
                bind_log;
         };
        category default {
                default_syslog;
         };
};

zone "." {
         type hint;
         file "named.root";
};

......

[/code:1:d452d51f00]

Then, Let's run a named with "option -t".

Step 1: check what is chroot's named process need.

[code:1:d452d51f00]

+/var/named($chroot)
 +---dev/
 |      +null

本文关键:A simple chroot of bind9.2.3 on FreeBSD5.x
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top