Samba as PDC

Hi I’m trying to setup a small test network with Samba as a Primary Domain Controller (PDC) for Windows boxs to connect to it. I’m kind new to Linux and don’t know where I am going wrong.

I’ve read and trying to setup Samba to do the PDC role. Below is the ‘global’ section of the smb.conf file.

[global]
	workgroup = 1domain
	server string =
	printing = cups
	printcap name = cups
	printcap cache time = 750
	cups options = raw
	map to guest = Bad User
	logon path = \\%L\profiles\.msprofile
	logon home = \\%L\%U\.9xprofile
	logon drive = P:
	usershare allow guests = No
	add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
	domain logons = Yes
	domain master = Yes
	security = user
	netbios name = test
	local master = Yes
	os level = 65
	preferred master = Yes
	wins support = yes
	debug level = 2
	dns proxy = yes
	time server = yes

I can ping the Linux box be the netbios name. Can see the Samba shares if in Windows I go to \ est.

But when I go to join the domain (1domain) I get the following error message.

"The following error occurred attempting to join the domain "1domain".

The specified domain either does not exist or could not be contacted.

Apart from editing the smb.conf file I have also added the user and client PC to the Linux box and edited the /etc/passwd file as below. Tutorial I was using said to put the $ after the PC name.

testuser:x:1003:100::/home/testuser:/bin/bash
adam-pc$:x:1005:100::/home/adam-pc:/bin/bash

Also I used the smbpasswd -s <username> and smbpasswd -a -m <client-pc>.

Rebooted the Linux box to confirm all settings/Samba was active with new settings then when I try to join the Domain I get that above error message.

I am running openSUSE 11.0.

Does anyone know any good tutorials I should have a read of on how to do what I am after, for beginners or can you provide any help with what else I might need to do or where I am going wrong.

Thanks in advanced.

Not much of an answer, but if you apply your changes trough the YaST Control Center > Network Services > Samba Server there is less of a chance of doing something wrong and it will restart samba for you after you press ‘Finish’.

Also make sure you got the appropriate ports open in the firewall (or temporarily disabled it), again this is made easier if you use YaST as it simply has a checkbox for opening the required ports in the firewall.

I’ve tried changing the settings in YaST before I started manually editing files. I seemed to get further manually editing files then I did with YaST.

Thank you for your advise but does anyone know where I can find a good manual/tutorial on setting up Linux as a PDC? That is up to date as well.

I really don’t care if I have to reinstall and start from scratch. But I’m starting to consider a Windows setup as I can do that with much less hassel, even though I would like to be able to do it in Linux.

P.S… Axeia, I tried doing it through YaST again and took a step back, now I am unable to ping the Linux box via NetBIOS name so something is either blocking the ping (firewall turned off though) or a setting was changed that did not revert back when I changed the Samba settings back to what they were before I changed them.

Sorry I should have explained what the end result is and what I am also trying to setup.

I would like SUSE to host (as per say) a Domain for Windows clients. So the Windows machines would join the domain and log into the domain when logging into Windows, and SUSE would host there home directories.

There’s already tons of HOWTO’s about this. Please READ READ READ before you start. A couple of things to consider:

All users have to exist as samba users as well as linux users.
It’s much easier to start with a completely “open” samba configuration (i.e. set security=share, make everything browsable etc. ) If that’s working ‘shut doors’. But first READ READ READ

On Sun March 29 2009 01:36 am, woofiedog wrote:

>
> Hi I’m trying to setup a small test network with Samba as a Primary
> Domain Controller (PDC) for Windows boxs to connect to it. I’m kind new
> to Linux and don’t know where I am going wrong.
>
> I’ve read and trying to setup Samba to do the PDC role. Below is the
> ‘global’ section of the smb.conf file.
>
>
> Code:
> --------------------
> [global]
<snip>
>
> --------------------
>
>
> I can ping the Linux box be the netbios name. Can see the Samba shares
> if in Windows I go to \ est.
>
> But when I go to join the domain (1domain) I get the following error
> message.
>
>
> Code:
> --------------------
> "The following error occurred attempting to join the domain “1domain”.
>
> The specified domain either does not exist or could not be contacted.
> --------------------
>
>
> Apart from editing the smb.conf file I have also added the user and
> client PC to the Linux box and edited the /etc/passwd file as below.
> Tutorial I was using said to put the $ after the PC name.
>
>
> Code:
> --------------------
> testuser:x:1003:100::/home/testuser:/bin/bash
> adam-pc$:x:1005:100::/home/adam-pc:/bin/bash
>
> --------------------
>
>
> Also I used the smbpasswd -s <username> and smbpasswd -a -m
> <client-pc>.
>
> Rebooted the Linux box to confirm all settings/Samba was active with
> new settings then when I try to join the Domain I get that above error
> message.
>
> I am running openSUSE 11.0.
>
> Does anyone know any good tutorials I should have a read of on how to
> do what I am after, for beginners or can you provide any help with what
> else I might need to do or where I am going wrong.
>
> Thanks in advanced.
>
>
woofiedog;

  1. Be sure the following ports are open on you firewall:
    TCP: 135,139,445
    UDP: 137,138
    You also need to allow broadcasts.
  2. Add users with smbpasswd -a <username>
  3. Make certain both smbd and nmbd are running
    4 Here are some general guides:
    A. This is meant for workgroups but covers a lot of basic ideas:
    http://www.swerdna.net.au/linux.html
    B. This is written for SLES but Samba is Samba.
    http://www.pcc-services.com/sles/samba.html
    You probably do not need the ldap backend, but I would recommend the tdbsam
    backend.
    C. Read the first few chapters here:
    http://samba.org/samba/docs/man/Samba-Guide/
    This is also available as:
    /usr/share/doc/packages/samba/Samba3-ByExample.pdf
    (I assume you installed the doc rpm)


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Tryed to follow the guide on Howto setup SUSE 11.1 as Samba PDC - openSUSE with a minimal infrastructure created in VMware - 1 opensuse 11.1 box and 1 XP box.
On the opensuse the installation goes almost ok with few exceptions:

  • for the CPAN packages install bundle its not so “bundle” so you need to install by hand some of them like String, Map, MapUTF8…
  • in the smb.conf file you need to comment “ldapsam:trusted = yes” line, otherwise samba will crash whenever will try to map user “nobody”

And everything works fine…,but when i try to join the xp box to the domain i get the following error:

A domain controller for the domain xxx.yyy.zz could not be contacted.
Ensure that the domain name is typed correctly.
If the name is correct, click Details for troubleshooting information.

If i click details i get this answer:
**Note: This information is intended for a network administrator. If you are not your network’s administrator, notify the administrator that you received this information, which has been recorded in the file C:\WINDOWS\debug\dcdiag.txt.

DNS was successfully queried for the service location (SRV) resource record used to locate a domain controller for domain xxx.yyy.zz:

The query was for the SRV record for _ldap._tcp.dc._msdcs.xxx.yyy.zz

The following domain controllers were identified by the query:

pdc.xxx.yyy.zz

Common causes of this error include:

  • Host (A) records that map the name of the domain controller to its IP addresses are missing or contain incorrect addresses.

  • Domain controllers registered in DNS are not connected to the network or are not running.

For information about correcting this problem, click Help.
**

Which is not the case. A nslookup on the Xp box is resolving the dns and the domain name, the query for A record of the domain name is resolved. On the linux box both dig and nslookup are resolving the xp box in both directions. A check with sleuth package of the dns configuration reports some warnings about missing the second dns, but no error…

Did anybody meet this problem, do you have any idea why?

thx