устанавливаем samba4 на ubuntu

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install git

git clone git://git.samba.org/samba.git samba-master; cd samba-master

git pull

sudo apt-get install build-essential libattr1-dev libblkid-dev libgnutls-dev lib64readline-gplv2-dev python-dev autoconf python-dnspython gdb pkg-config bind9utils libpopt-dev

./configure.developer

make

sudo make install

sudo rm /usr/local/samba/etc/smb.conf

sudo ./source4/setup/provision --realm=hostname.example.com --domain=HOSTNAME --adminpass=y0urPassw0rd --server-role='domain controller'

sudo apt-get install phpldapadmin
sudo cp /usr/local/samba/private/phpldapadmin-config.php /etc/phpldapadmin/config.php

в файле /etc/resolv.conf:
domain hostname.example.com

samba -i -M single

sudo cp /usr/local/samba/private/krb5.conf /etc/


... надо дописать ...

Полезные ссылки:
http://help.ubuntu.ru/wiki/samba4
http://wiki.samba.org/index.php/Samba4/HOWTO