bonjours,
j’ai du louper une étape, j’ai utilisé makejail en ajoutant l’installation du packet bind9 dans la prison.
la partie qui concerne l’utilisateur bind dans etc, et les libs manquantes, la config de zone est bonne.
aussitôt que j’ajoute chroot [PATH] devant daemon-start-stop --start --quiet …etc, il me dit que l’utilisateur “bind” n’existe pas. or il existe bien.
quand j’ajoute “-t [path]” aux OPTIONS de /default/bind9, c’est pas mieux, il ne me dit rien du tout mais ne demarre pas pour autant.
par defaut l’utilisateur bind n’a pas de shell… faut il lui donner chroot pour shell ?
j’ai utilisé plusieurs tutos mais il semblerais que des étapes soient sauté sur chacun d’eux…
help please…
CHROOT/
.
|-- bin
| |-- bash
| |-- dnssec-keygen
| |-- dnssec-signzone
| |-- false
| |-- named
| |-- named-checkconf
| |-- named-checkzone
| |-- rndc
| |-- rndc-confgen
| `-- sh -> bash
|-- dev
| |-- null
| `-- random
|-- etc
| |-- bind
| | |-- db.0
| | |-- db.127
| | |-- db.255
| | |-- db.empty
| | |-- db.local
| | |-- db.root
| | |-- named.conf
| | |-- named.conf.local
| | |-- named.conf.options
| | |-- rndc.key
| | `-- zones.rfc1918
| |-- group
| |-- host.conf
| |-- hostname
| |-- hosts
| |-- hosts.allow
| |-- hosts.deny
| |-- init.d
| | `-- bind9
| |-- localtime
| |-- passwd
| |-- resolv.conf
| `-- shadow
|-- lib
| |-- ld-linux.so.2
| |-- libncurses.so.5 -> libncurses.so.5.5
| |-- libncurses.so.5.5
| `-- tls
| `-- i686
| `-- cmov
| |-- libc-2.3.6.so
| |-- libc.so.6 -> libc-2.3.6.so
| |-- libdl-2.3.6.so
| |-- libdl.so.2 -> libdl-2.3.6.so
| |-- libnsl-2.3.6.so
| |-- libnsl.so.1 -> libnsl-2.3.6.so
| |-- libpthread-2.3.6.so
| `-- libpthread.so.0 -> libpthread-2.3.6.so
|-- proc
|-- sbin
| |-- dnssec-keygen
| |-- dnssec-signzone
| |-- named
| |-- named-checkconf
| |-- named-checkzone
| |-- rndc
| |-- rndc-confgen
| `-- start-stop-daemon
|-- usr
| |-- lib
| | |-- i686
| | | `-- cmov
| | | `-- libcrypto.so.0.9.8
| | |-- libbind9.so.0
| | |-- libbind9.so.0.0.7
| | |-- libcrypto.so.0.9.8
| | |-- libdns.so.21 -> libdns.so.21.0.2
| | |-- libdns.so.21.0.2
| | |-- libisc.so.11 -> libisc.so.11.0.1
| | |-- libisc.so.11.0.1
| | |-- libisccc.so.0
| | |-- libisccfg.so.1
| | |-- liblwres.so.9
| | |-- libz.so.1 -> libz.so.1.2.3
| | `-- libz.so.1.2.3
| |-- sbin
| | |-- dnssec-keygen
| | |-- dnssec-signzone
| | |-- named
| | |-- named-checkconf
| | |-- named-checkzone
| | |-- rndc
| | `-- rndc-confgen
| `-- share
`-- var
|-- cache
| `-- bind
|-- log
| |-- messages
| |-- syslog
| |-- syslog.0
| |-- syslog.1.gz
| |-- syslog.2.gz
| |-- syslog.3.gz
| `-- syslog.4.gz
`-- run
`-- bind
`-- run
/ETC/DEFAULT/BIND9
OPTIONS="-u bind -t /chroot/bind"
# Set RESOLVCONF=no to not run resolvconf
RESOLVCONF=yes
/ETC/INIT.D/BIND9
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
# for a chrooted server: "-u bind -t /var/lib/named"
# Don't modify this line, change or create /etc/default/bind9.
OPTIONS=""
RESOLVCONF=yes
test -f /etc/default/bind9 && . /etc/default/bind9
test -x /usr/sbin/rndc || exit 0
. /lib/lsb/init-functions
DISTRO=$(lsb_release -is 2>/dev/null || echo Debian)
case "$1" in
start)
log_daemon_msg "Starting domain name service..."
modprobe capability >/dev/null 2>&1 || true
# dirs under /var/run can go away on reboots.
mkdir -p /var/run/bind/run
chmod 775 /var/run/bind/run
chown root:bind /var/run/bind/run >/dev/null 2>&1 || true
if [ ! -x /usr/sbin/named ]; then
log_action_msg "named binary missing - not starting"
log_end_msg 1
exit 1
fi
if [ ! -e /chroot/bind/proc/device ]; then mount -t proc proc /chroot/bind
if chroot /chroot/bind start-stop-daemon --start --quiet --exec /usr/sbin/named \
--pidfile /var/run/bind/run/named.pid -- $OPTIONS; then
if [ "X$RESOLVCONF" != "Xno" ] && [ -x /sbin/resolvconf ] ; then
echo "nameserver 127.0.0.1" | /sbin/resolvconf -a lo.named
fi
fi
log_end_msg 0
;;
stop)
log_daemon_msg "Stopping domain name service..."
if [ "X$RESOLVCONF" != "Xno" ] && [ -x /sbin/resolvconf ] ; then
/sbin/resolvconf -d lo.named
fi
/usr/sbin/rndc stop
log_end_msg 0
if [ -e /chroot/bind/proc/device ]; then umount /chroot/bind/proc
;;
reload|force-reload)
log_daemon_msg "Reloading domain name service..."
/usr/sbin/rndc reload
log_end_msg 0
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
log_action_msg "Usage: /etc/init.d/bind9 {start|stop|reload|restart|force-reload}"
exit 1
;;
esac
exit 0
PASSWD
bind:x:200:200::/chroot/bind:/bin/false
GROUP
bind:x:200:bind
lancement bind9:->