[Samba] RFC2307, AD, and Samba 3.6

steve steve at steve-ss.com
Mon Aug 13 00:19:24 MDT 2012


On 08/12/2012 08:49 PM, Nick Triantos wrote:
> Thanks very much.
>
> For some reason, this time, when I uncommented those idmap range lines, it all worked.
>
> Steve, to use rfc2307 out of the box, how do I specify uids for my users? I installed sfu to get the tab in the Users & Computers where I could set stuff like shell, uid, etc.
>
> thanks,
> -Nick
Hi Nick
We just wrote a quick script add users and setup some sensible defaults:

In this example:
Our unixHomeDirectory is under /home2 and we gave the Domain Users group 
a gidNumber of 20513
Or DC is called hh3.

samba-tool user add $1
echo Updating directory with uid $uid
sleep 1
echo "dn: cn=$1,cn=Users,dc=hh3,dc=site
changetype: modify
add: objectClass
objectClass: posixAccount
-
add: uidNumber
uidNumber: $uid
-
add: gidNumber
gidNumber: 20513
-
add: unixHomeDirectory
unixHomeDirectory: /home2/$2/$1
-
add: loginShell
loginShell: /bin/bash
-
add: profilePath
profilePath: \\\\hh30\\profiles\\$1
-
add: homeDirectory
homeDirectory: \\\\hh30\\$2\\$1
-
add: homeDrive
homeDrive: Z:" > /tmp/$1
ldbmodify --url=/usr/local/samba/private/sam.ldb /tmp/$1

We also have a full script called s4bind which does everything for users 
and groups for you without ever touching a windows box:
http://linuxcostablanca.blogspot.com.es/p/s4bind.html
HTH
Steve




More information about the samba mailing list