[Samba] add machine script

Michel Gallant support at mindsweep.ca
Thu Apr 17 13:02:45 GMT 2003


I'm using samba 3.0 alpha 23 on debian woody using a tdb backend.  I've written a simple add machine script that takes care of the useradd and pdbedit -a -m steps.  When I try to add a machine to the domain directly from that machine, without creating the accounts beforehand, I get an "Access Denied" error.  After getting this error, I check on the samba machine and see that the account has been created in both /etc/passwd and my passwd.tdb file.  If I try to join the machine to the domain again right away, it's successfull.  Do I have to return something from my script?  Here's the simple batch file I'm using:

#!/bin/sh
/usr/sbin/useradd -d /dev/null -g 2001 -s /bin/false $1
/usr/bin/pdbedit -a -m $1
/usr/bin/pdbedit -f 'Machine Account' -h '' -D '' $1



More information about the samba mailing list