homehowtokbslinksaboutcontactprojectsmusic

Index > Help Tutorials > Samba PDC on Ubuntu
SAMBA DOMAIN CONTROLLER WITH WINBIND SUPPORT      I am assuming that you are working as root user, if you are not don't forget to add sudo in beging of each line! So lets start by installing those:
apt-get install samba smbdclient winbind
After installing these packages you have two services running so just stop them for now by running these commands
/etc/init.d/samba stop
/etc/init.d/winbind stop
Both service are stopped now so please clear some temporary files by running these commands:
rm /var/lib/samba/*.tdb
rm /var/run/samba/*.tdb
rm /var/cache/samba/*.tdb
Edit samab configuration file by running following codes
gedit /etc/samba/smb.conf
Add following to that file
[global]
workgroup = MYDOMAIN (change it with your domain name)
netbios name = ubuntu (name of domain controller)
logon drive = H: 
domain master = yes
preferred master = yes
domain logons = yes
wins support = yes
passdb backend = tdbsam
encrypt passwords = yes
security = user
logon script = logon.cmd 

[homes]
comment = Home
path = %H
read only = no
browseable = no

[printers] 
comment = All Printers
path = /var/spool/samba
printable = yes
public = no
writable = no
create mode = 0700
browseable = no

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
write list = root

[netlogon]
path = /netlogon
read only = yes
guest ok = yes 	 
That is all we need for a basic but reliable samba setup, you can comment the rest of this file for now and later on umcomment whatever thing/s you want add in configuration. Now start samba and winbind
 
/etc/init.d/samba start
/etc/init.d/winbind start
Edit host file and replace 127.0.1.1 with IP address of your machine (samba server)
gedit /etc/hosts
Edit nsswitch.conf file
gedit /etc/nsswitch.conf 
and find hosts, add files wins in front of hosts, it will change the name resolve order and will use wins first before dns Add root user in samba database by setting its samba password
smbpasswd -a root 
Restart samba and winbind
/etc/init.d/samba restart
/etc/init.d/winbind restart
If every thing went well you will be able to test your server so do this
smbclient -L localhost 
Enter root's samba password, if every thing went well we will see our new domain Good luck ! Now we have samba running and it is time to add some neccessary groups in samba database so puch these codes in or copy paste
net groupmap add ntgroup="Domain Admins" unixgroup="root" type=domain
net groupmap add ntgroup="Domain Users" unixgroup="users" type=domain -U root
net groupmap add ntgroup="Domain Guests" unixgroup="nogroup" type=domain -U root
That is it you done now you should be able to join machines to this domain, but you have to add names of all machines you want to join to this domain, in samba database.
useradd xpmachine$ 
smbpasswd -a -m xpmachine$ 
Now go to your xp machine and right click on my computer and select computer name then select change and click on domain radio and type your new domain. It will prompt you for samba password so enter root as user ID and root's samba password and hit enter you will see a message like welcome to domain. Restart the machine and try to logon to that domain. you will be able to do that. To add share(s) in samba domain go to /etc/samba/smb.conf file and added some thing like this:
[sharename]
path = /home/sharename or whatever the path is
browseable = yes
read only = yes/no depanding on you requirements
Note: All stated above configuration will get you started and will make a very basic setup for you if you want some customization you are on your own! TFTP and PXE
apt-get install tftpd-hpa tftp-hpa lftp
nano /etc/default/tftpd-hpa
and change "no" to "yes"
/etc/init.d/tftpd-hpa restart
will restart tftp server Images