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 if you want to use script for instance map drives etc.
[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 if you using script, it has to be located in this directory
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 and leave the rest as it is
Add root user in samba database by setting its samba password
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$ xpmachine is the name in of windows workstation, feel free to change it.
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 & PXE
apt-get install tftpd-hpa tftp-hpa lftp gedit /etc/default/tftpd-hpa and change "no" to "yes" /etc/init.d/tftpd-hpa restart will restart tftp server Images