[Samba] Re: Trying to add machine accounts on the fly
juha.pietikainen at connet.net
Thu Oct 6 05:53:41 GMT 2005
try to add these scripts in your smb.conf file:
add user script = /usr/sbin/useradd -m %u
delete user script = /usr/sbin/userdel -r %u
add group script = /usr/sbin/groupadd %g
delete group script = /usr/sbin/groupdel %g
add user to group script = /usr/sbin/usermod -G %g %u
delete user from group script = /usr/sbin/userdel %g %u
set primary group script = /usr/sbin/usermod -g '%g' '%u'
add machine script = /usr/sbin/useradd -d /dev/null -g 501 -s /bin/false -M
Your "add user script" is actually "add machine script" so change it like
above example shows.
These work at least with usrmgr.exe in my Win XP Pro and samba-3.0.20a
(Fedora Core 1) server .
I have Fedora Core 4 installed and have configured the smb.conf file as a
the problem i have is that i will be adding 250 win XP sp2 machines to this
and I need to be able to create the machine account on the fly.
However no matter what i do i can't get my Win XP machines to connect
manuelly adding the machine accounts which will not work for me.
When i try and connect from the XP machines i get the following error.
The following error occured attempting to join the domain "etnet"
the user name could not be found
Also i did do "smbpasswd -a root and added a password.
Also, when i check out /var/log/samba i see a log file with the ip address
of my test XP box. Also there is a log file with the machine name of the
same box. When i cat both files they are empty.
here is the smb.conf
Note that i have the add user script, group 501 is a group i created named
# Global parameters
workgroup = ETNET
server string = ETNET PDC
passwd program = /usr/bin/passwd %u
passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n
username map = /etc/samba/smbusers
unix password sync = Yes
log file = /var/log/samba/%m.log
max log size = 50
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
printcap name = /etc/printcap
add user script = /usr/sbin/useradd -d /dev/null -g 501 -s /bin/false -M %u
domain logons = Yes
os level = 33
preferred master = Yes
domain master = Yes
dns proxy = No
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
hosts allow = 10.78., 127.
cups options = raw
comment = Home Directories
read only = No
browseable = No
comment = Network Logon Service
path = /home/netlogon
guest ok = Yes
share modes = No
comment = All Printers
path = /var/spool/samba
printable = Yes
browseable = No
More information about the samba