Samba as PDC

Hello to all! I’m new to this site so be easy on me…LOL!

I have a question on Samba and setting up a domain server. I have tried for 3 days (at night) and without success. I have read and searched many web pages and still haven’t had any luck. I can get the shared folder to work, but not really what I’m looking for.

Here is what I was hoping to get out of creating a domain.

  1. Have a media folder that gets mapped to the other computers when you log into the domain.
  2. Store profiles for windows XP work system (and if needed with linux desktop home system).
  3. Possible use Xen to create an XP virtualization for when I need to sync my Ipod Touch (thru the Linux desktop system) Would rather not use dual boot or linux for Ipod Touch. (I like the Itunes interface and app store that they just added).

Could someone help point me in the right direction for reading material or insight into how to do this. I’m so confused on whether I need LDAP, Quota, SSH, etc. that its mind boggling to me.

1 last thing…do many of you recommend using Webmin to control the server if you don’t use a full GUI system? My first attempt with OpenSuse and a domain, I installed the Minimum xserver and was ok with using that, the only problem was that when I would use Yast2 to make changes, it seemed that they didn’t get written back to the config files.

Sorry so long winded for my first post, just wanted to give as much info as possible.

linuxfan 14 wrote:

>
> Hello to all! I’m new to this site so be easy on me…LOL!
>
> I have a question on Samba and setting up a domain server. I have
> tried for 3 days (at night) and without success. I have read and
> searched many web pages and still haven’t had any luck. I can get the
> shared folder to work, but not really what I’m looking for.
>
> Here is what I was hoping to get out of creating a domain.
> 1. Have a media folder that gets mapped to the other computers when
> you log into the domain.
> 2. Store profiles for windows XP work system (and if needed with linux
> desktop home system).
<snip>

Samba works well for Windows profiles, shares and printing. (Not sure about
Linux profiles, never tried that.)
> 1 last thing…do many of you recommend using Webmin to control the
> server if you don’t use a full GUI system? My first attempt with
> OpenSuse and a domain, I installed the Minimum xserver and was ok with
> using that, the only problem was that when I would use Yast2 to make
> changes, it seemed that they didn’t get written back to the config
> files.
Webmin is my preferred configuration tool, even with a GUI. I prefer it
over YAST, which sometimes seems to write configs that were not desired.
I’m sure that’s due to user error and not to YAST. I just feel Webmin is
easier, moreover you can use it remotely.
> Sorry so long winded for my first post, just wanted to give as much
> info as possible.
>
>
Best of luck. I’m sure you will get other replies.

P. V.
“We have met the enemy an he is us” Pogo

Thanks for the reply PV.

I was hoping I would get more of a response on this, but maybe after the weekend.

linuxfan 14 wrote:

>
> Thanks for the reply PV.
>
> I was hoping I would get more of a response on this, but maybe after
> the weekend.
>
>
Linuxfan;

I forgot to mention last night, but you can put logon scripts in Samba’s
NETLOGON share that will be executed by the client when they logon. You can
use this share to assure a particular directory is mounted by the client. It
works just like a MicroSoft DC.

P. V.
“We have met the enemy an he is us” Pogo

Which version of openSUSE are you using? I have Samba as a PDC working in 10.3, but it will not work in 11.0. I can join the workstation to the domain, but users can not logon and it complains there is no trust relationship between the server and the workstation.

Regards,
Horst

hbsimon wrote:

>
> Which version of openSUSE are you using? I have Samba as a PDC working
> in 10.3, but it will not work in 11.0. I can join the workstation to
> the domain, but users can not logon and it complains there is no trust
> relationship between the server and the workstation.
>
> Regards,
> Horst
>
Horst;

When you upgraded to 11.0, did you remember to preserve the Domain SID. If you
did the clean install, Samba will have generated a new SID. Unless you restore
your old SID, you will likely need to rejoin all your clients to, what is now,
the new domain. If you know the old domain SID, try : “net setlocalsid
S-1-5-21-x-y-z”.

Samba 3.2.0 works just fine as a PDC


P. V.
“We have met the enemy an he is us” Pogo

Horst,
I’m using 11. I haven’t even got the trust comment. I just keep getting stuck at the login portion from a windows system, stating no user account created. I have the user created in OpenSuse, but know I’m missing something else too. I just did a new install again and added XFCE to have a Gui. Will continue to try and hopefully get it working.

PV, Thanks for your reply about that script file running at a new login, so that a drive letter gets mapped for my media. Might you have anything handy? I don’t know anything about writing scripts.

linuxfan 14 wrote:

>
> Horst,
> I’m using 11. I haven’t even got the trust comment. I just keep
> getting stuck at the login portion from a windows system, stating no
> user account created. I have the user created in OpenSuse, but know
> I’m missing something else too. I just did a new install again and
> added XFCE to have a Gui. Will continue to try and hopefully get it
> working.
Have you added Samba users with “smbpasswd -a <username>”?

May I suggest you look at this How-T0:
http://www.swerdna.net.au/linux.html
It is not aimed at setting up a PDC but you should read it over. In addition
Chapter 2 of “Samba3 by Example” shows sample PDC configurations. Look here:
/usr/share/doc/packages/samba
or here:
http://www.samba.org.

> PV, Thanks for your reply about that script file running at a new
> login, so that a drive letter gets mapped for my media. Might you have
> anything handy? I don’t know anything about writing scripts.
>

You just place a standard DOS BATCH file in the netlogon share.

In your global section you need to identify the name of the script with the
parameter "logon script = " (e.g. logon script = logon.bat). This can take
wild cards, so at least in theory you could have logon scripts per machine or
per user. If you Google “logon.bat”, you will find lots of examples; pay
attention to NET USE. This script is a file read by the Windows machine so the
syntax is that of Windows. I would suggest you create it with NOTEPAD on an MS
machine and copy it into the netlogon share. See the manual entry for “logon
script”


P. V.
“We have met the enemy an he is us” Pogo

I have this problem only on openSUSE 11.0 (New install no upgrade). I have it working fine on 10.3 and previous versions, I used the same configuration files (smb.conf,ldap.conf, slapd.conf and /etc/ldap.conf), the smbldap configuration files and ldap population was done new using thr same procedure which worked in 10.3. I can add the workstation to the domain, but when I try to logon as a domain user I get the error that the domain is not found. After logging in as a Local Administrator I can browse the domain and when opening a share I can use the domain user account to open the share. Something in the security of samba ore openSUSE between 10.3 and 11.0 must have changed.

Thanks and Regards,
Horst

hbsimon wrote:

>
> I have this problem only on openSUSE 11.0. I have it working fine on
> 10.3 and previous versions, I used the same configuration files and
> procedure which worked in 10.3, for 11.0. I can add the workstation to
> the domain, but when I try to logon as a domain user I get the error
> that the domain is not found. After logging in as a Local Administrator
> I can browse the domain and when opening a share I can use the domain
> user account to open the share. Something in the security of samba ore
> openSUSE between 10.3 and 11.0 must have changed.
>
> Thanks and Regards,
> Horst
>
>
Horst;

I’ll need to think about this for a while. You should probably open a new thread
for this problem and describe what you have done and what is failing. It might
help to post your smb.conf.

P. V.
“We have met the enemy an he is us” Pogo

PV, thanks for your help. I will look into the logon.bat file.

I have finally gotten it to work as a domain. Not sure if its right or not, I seem to have alot of folders with the same user name in different locations. Maybe they are all linked paths somehow, but at least its a start and I can now tweak it and make it better.

Horst,
not sure if this will help, but here is a link that I used to get mine working…
Using Samba 3rd Edition
chapter 9 was the most help, but had to refer to other chapters for some of it to make sense. It still doesn’t, but that is what learning is all about…:slight_smile:

1 last question (for now at least)…
PV,
in this Samba3 link that I posted, I had to ntgroup a SID number for the windows user. Is this always the case when having a Samba server talk with a windows system? Also, I had to create a Domain Admin for the windows system, but didn’t do it on the windows system…it was all done on the server side. This doesn’t make sense to me, so was just looking for some lamens terminology. In my small mind, I was just hoping to create a username and password on the server side and then login from the windows system. Which is what I have done, but the whole windows Domain admin has me confused. This is all in chapter 9 (9.2.1. Setting Up Domain Joins) if your interested in looking at it.

Thanks again, I really appreciate it!

Changed to thread openSUSE11 and Samba/LDAP as PDC and included smb.conf in this thread

linuxfan 14 wrote:

>
> PV, thanks for your help. I will look into the logon.bat file.
>
> I have finally gotten it to work as a domain. Not sure if its right or
> not, I seem to have alot of folders with the same user name in different
> locations. Maybe they are all linked paths somehow, but at least its a
> start and I can now tweak it and make it better.
>
<snip>
>
> 1 last question (for now at least)…
> PV,
> in this Samba3 link that I posted, I had to ntgroup a SID number for
> the windows user. Is this always the case when having a Samba server
> talk with a windows system? Also, I had to create a Domain Admin for
> the windows system, but didn’t do it on the windows system…it was
> all done on the server side. This doesn’t make sense to me, so was just
> looking for some lamens terminology. In my small mind, I was just
> hoping to create a username and password on the server side and then
> login from the windows system. Which is what I have done, but the
> whole windows Domain admin has me confused. This is all in chapter 9
> (9.2.1. Setting Up Domain Joins) if your interested in looking at it.
>
> Thanks again, I really appreciate it!
>
>
linuxfan;

Glad to see you got it working. There is no reason you actually need a logon
script, in fact I’ve rarely used it. However if you want windows to access a
share as a drive you do need it.

Windows has a number of groups that are builtin (e.g. Domain Admins, Domain
Users). In order for groups to work right and to satisfy the logic of Windows,
these groups need to be associated with a Linux/Unix group. The standard way
to do this is with “net groupmap”. See the manual entry under net; (man net).

What follows is a little shell script to set up this association. It is saved
in a file initGrps.sh which is made executable. Of course each of the commands
could be executed in a stand alone manner, but with my typing I would get them
wrong 50% of the time. This shell script allows be to edit everything first
before I commit. As an added benefit, once it is created you can run it every
time you setup a new domain. Only the first three entries are really needed,
the rest are fluff. If you have set up your own groups (e.g. sales,
engineering, management) you could associate the Windows group with a Linux
group. This is the contents of my init.Grps.sh:

#!/bin/bash

#initGrps.sh

#Map Windows Domain Groups to Unixgroups
net groupmap add rid=512 unixgroup=root type=d ntgroup=“Domain Admins”
net groupmap add rid=513 unixgroup=users type=d ntgroup=“Domain Users”
net groupmap add rid=514 unixgroup=nobody type=d ntgroup=“Domain Guests”

#Map Windows XP local groups to local UNIX groups
net groupmap add rid=544 unixgroup=root type=l ntgroup=“Administrators”
net groupmap add rid=545 unixgroup=users type=l ntgroup=“Users”
net groupmap add rid=546 unixgroup=nobody type=l ntgroup=“Guests”
net groupmap add rid=549 unixgroup=daemon type=l ntgroup=“System Operators”
net groupmap add rid=548 unixgroup=wheel type=l ntgroup=“Account Operators”
net groupmap add rid=551 unixgroup=bin type=l ntgroup=“Backup Operators”
net groupmap add rid=550 unixgroup=lp type=l ntgroup=“Print Operators”
net groupmap add rid=552 unixgroup=kmem type=l ntgroup=“Replicators”
net groupmap add rid=547 unixgroup=ntadmin type=l ntgroup=“Power Users”

I owe you an apology, when I read your first post I thought you were seeking
general information not information about a specific problem. Rereading that
post I can see that it was MY error. Had your first post been properly
understood you could have been up and running a lot faster. Please accept my
apology.

I still think you might find reading the “Samba3 by Example” reference I gave
you informative. This is kept up to date with an evolving Samba. If you need
additional help feel free to post. Next time I promise to get it right.

P. V.
“We have met the enemy an he is us” Pogo

PV,
No worries at all about misreading my original post. I truely appreciate you helping me out. Your script is greatly appreciated as well. I do want to set up another computer. 1 windows system for the wife, 1 windows system for work, and 1 linux system for me and then have the server supply virtualization to my linux system for Ipod touch and Itunes, so your script will definately come in handy with both windows systems.

Thanks again!