[KLUG Members] Help! Samba LDAP 2.2.8a - can't add a machine

Adam Williams members@kalamazoolinux.org
Sun, 11 Jan 2004 13:31:49 -0500


> Background:
> samba-server-ldap-2.2.8a-13mdk
> samba-client-2.2.8a-13mdk
> samba-swat-ldap-2.2.8a-13mdk
> samba-winbind-ldap-2.2.8a-13mdk
> nss_ldap-207-4.1.92mdk
> openldap-2.1.22-5mdk
> pam_ldap-164-4.1.92mdk
> I'm really quite confused by this.
> As shown, I can add a machine from the command line with no trouble.
> [root@testbox root]# /usr/share/samba/scripts/smbldap-useradd.pl -w -d
> /dev/null -g machines -c 'Machine Account' -s /bin/false dummyacct
> [root@testbox samba]# getent passwd | grep dummyacct
> dummyacct$:x:1003:421:dummyacct$:/dev/null:/bin/false
> [root@testbox samba]#
> Samba seems to be configured correctly:
> [root@testbox samba]# cat smbusers
> # Unix_name = SMB_name1 SMB_name2 ...
> root = @adm Administrator administrator root admin @Administrators
> nobody = guest pcguest smbguest

Don't know what your trying to accomplish here; smbusers is a gnarly
hack and I've never had any need to use it.  

You can't logon to a domain from a machine that hasn't joined the
domain,  and you can't join the domain if you've established any
other-credential connections to a domain resourse, and you'll be
prompted for a user/secret pair if you attempt to join the domain as a
local administrator - so why all this fuss about mapping administrator
to something?  Just logon as the logon administrator, select join
domian, and when prompted enter root and root password.  Once that works
you can try mangling names,  but don't try to debug/setup a process
while using mangled names.  They say journey of a thousand miles begins
with a single step, and not a game of hop-scotch, for a reason.

And your setting "username map" equal to the absolute path to your
smbusers file?

> ...and yet I can't get Samba to add a machine account automatically.
> I wrote a test script:
> #!/bin/bash
> echo `date` 1> output.txt
> /usr/bin/smbldap-useradd -w -d /dev/null -g machines -c 'Machine
> Account' -s /bin/false $1 >> output.txt

And you know what the current working directory of this script is?  Add
a "cd /tmp" after "#!/bin/bash".

> ...but Samba never runs it

You set the "add user script" to the absolute path of this script?