Differences between revisions 8 and 10 (spanning 2 versions)
Revision 8 as of 2007-05-03 02:03:59
Size: 5225
Editor: ?BobBobly
Revision 10 as of 2007-05-03 02:26:10
Size: 5365
Editor: ?BobBobly
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
JoinCapitalizedWords; ["Back to Building a Linux Domain"] [http://wiki.debian.org/BuildingALinuxDomain]; [Building A Linux Domain].
Line 162: Line 163:
||First Name||Last Name||username||UID||SID ending||Home Directory|| ||First Name||Last Name||username||UID||SID ending||Group||Home Directory||

?JoinCapitalizedWords; ["Back to Building a Linux Domain"] [http://wiki.debian.org/BuildingALinuxDomain]; [Building A Linux Domain].

How to create samba3 PDC with ldap backend

Install LDAP

aptitude install slapd 

Enter password for the ldap admin when prompted

Install PHPLDAPADMIN web interface

aptitude install apache-ssl phpldapadmin

Enter your country code when prompted ex. US?BR Enter the name of your state when prompted ex. Utah?BR Enter the name of your city when prompted ex. Salt Lake City?BR Enter your organization when prompted ex. buster.lan?BR Enter your OU name when prompted ex. ITT?BR Enter your host name when prompted ex. pdc.buster.lan?BR Enter the contact email when prompted ex. root@buster.lan?BR


wget http://www.nomis52.net/data/mkntpwd.tar.gz
tar zxvf mkntpwd.tar.gz
cd mkntpwd
cp mkntpwd /usr/local/bin/

Install Samba

aptitude install make gcc libc-dev samba samba-doc

Enter your domain name when prompted ex. buster.lan?BR Answer NO when asked whether you want to modify smb.conf or not?BR

cd /usr/share/doc/samba-doc/examples/LDAP
gunzip samba.schema.gz
cp samba.schema /etc/ldap/schema/
vim /etc/ldap/slapd.conf

add this line after the other include lines:

include         /etc/ldap/schema/samba.schema

Now restart LDAP

/etc/init.d/slapd restart

open a webbrowser and go to: https://pdc/phhldapadmin/ (replace pdc with your server name or IP)?BR login with the following user:?BR


use the password entered when you installed LDAP?BR expand the root node and then click on “Create new entry here”?BR select OU and click “proceed”?BR enter users for the OU name and click “Create object”?BR repeat the previous three steps and create two other OUs called “groups” and “machines”?BR

vim /et c/samba/smb.conf


passdb backend=tdsam

and replace it with:

passdb backend = ldapsam:ldap://
ldap suffix = dc=nomis52,dc=net
ldap machine suffix = ou=machines
ldap user suffix = ou=users
ldap group suffix = ou=groups
ldap admin dn = cn=admin,dc=nomis52,dc=net
ldap delete dn = no

# be a PDC
domain logons = yes

# allow user privileges
enable privileges = yes

make sure testparm executes successfully:


Set the samba password and restart samba

smbpasswd -w password
/etc/init.d/samba restart

Log back into phpldapadmin and verify that the ?DomainName record exists below the root?BR create the following Samba3 Mappings under the groups OU:[[BR]]

Unix/Windows Name


SID ending number










aptitude install libnss-ldap

Enter the server name as ldap:// when prompted?BR put in the search base as dc=buster,dc=lan (replace with your domain structure)?BR put in the samba version as 3?BR enter the admin profile as cn=admin,dc=buster,dc=lan (replcae with your domain structure)?BR enter the admin password?BR accept with OK?BR

vim /etc/nsswitch.conf

add “ldap” after every compat?BR

verify that users, guests, and admins exist by executing:

getent group

aptitude install libpam-ldap

Answer yes?BR Answer no?BR Enter the admin profile - cn=admin,dc=buster,dc=lan (replace with your domain structure)?BR Enter your admin password?BR

vim /etc/pam.d/common-account

add the following to the end of the file:

account         sufficient      pam_ldap.so
account         required        pam_unix.so     try_first_pass

vim /etc/pam.d/common-auth

add the following line to the beginning of the file:

password sufficient pam_ldap.so

restart ssh and samaba

/etc/init.d/ssh restart (if ssh is installed)
/etc/init.d/samba restart

install nscd

aptitude install nscd
vim /etc/samba/smb.conf

add the following line to the file:

ldap password sync=yes

log back into phpldapadmin and create the following Samba3 Users under the users OU:

First Name

Last Name



SID ending


Home Directory















verify the new users are in the database:

getent passwd

create home directory

mkdir /home/buster
mkdir /home/buster/(username)
cp /etc/skel/.* /home/buster/(username)
chown -R (username):users /home/buster/(username)

log back into phpldapadmin and create the a Samba3 machines under the machines OU:

Machine Name




smbpwd -a root

enter your root password

go to your windows machine and right-click on mycomputer and select properties?BR on the name tab select change?BR select the domain radio button and enter buster.lan and click ok?BR enter root for the username?BR enter your root password?BR you should see a welcome to the buster.lan domain message and then reboot and you can log in using user from your LDAP database.?BR