Monday, April 16, 2012

Active Directory with Samba 4 part 1

Samba 4 is developed to be a replacement of Microsoft Active Directory, it provides kerberos and directory service.With samba 4, you will have a free copy of Microsoft Active Directory.

Please remember that Samba 4 is still in alpha stage, so use it with your own risk.


Before you follow installation procedure from Samba 4 wiki, I suggest you to install bind (DNS Server) first, here is the steps:

Bind9 Installation

It is recommended to use bind 9.8 installed in the server. In debian 6, the current bind version included in the distribution is bind 9.7.3, so you need to compile new version of bind. Download a latest bind 9.8 version and then compile it.
apt-get install libkrb5-dev libssl-dev
tar -zxvf bind-9.8.0-P1.tar.gz
cd bind-9.8.0-P1
./configure --with-gssapi=/usr/include/gssapi  --with-dlopen=yes
make install
This will install bind9 in the /usr/local directory.

Create the Bind user and group:
groupadd named
useradd -d /var/named -g named -s /bin/false named
Create the Bind run directory:
mkdir -p /var/named
chown -R named:named /var/named
chmod -R 755 /var/named
Create /usr/local/etc/named.conf:
logging {
        channel "querylog" {
          file "/var/named/log/query.log";
          print-time yes;
        channel default_log {
          file "/var/named/log/named.log";
          print-time yes;
        category queries { querylog; };
        category default { default_log; default_debug; };
        category lame-servers { null; };

options {
        directory "/var/named";
        version "no thankyou";
        notify no;
#        tkey-gssapi-keytab "/usr/local/samba/private/dns.keytab";

#include "/usr/local/samba/private/named.conf";
Only uncomment the red line after you installed samba 4.

Create the Bind startup script bind9:
#! /bin/sh


case "$1" in
        echo -n "Starting named... "
        $NAMED_ROOT/sbin/named -u named -c $NAMED_ROOT/etc/named.conf && echo OK
        echo -n "Stopping named... "
        kill -15 `cat /var/run/named/` && echo OK
        $0 stop  &&  $0 start
        echo "Usage: $0 {start|stop|restart|reload}"
        exit 1
exit 0
Start bind9:
chmod +x bind9


Next >>

No comments: