[Samba] user / machine / group scripts, some work some don't

John H Terpstra jht at samba.org
Sun Sep 9 04:54:29 GMT 2007

On Saturday 08 September 2007 23:30, Michael Schmitt wrote:
> Hi List,
> I have some issues with user manager for domains (srvtools.exe from MS)
> and the scripts mentioned in the subject. The examples from the samba
> howto collection seem to cause serious issues here. I am on debian etch
> and tried to create my own scripts but till now to now avail. With the
> examples from the docs I could add groups, but could not add users to
> groups. There was the option -A used but here it seems to be -a refering
> to the manpage (log was helping here)... anyhow changed to -a and it
> worked. But adding users does not work at all. Different syntax,
> different problems, but nothing does work. With the example of the howto
> collection the user manager gave me "access denied" or similar
> (translated from german) as I tried to add a user. I tried to use
> adduser instead of useradd and came to these syntaxes:

Please check the man page for your distro.  The options to useradd, usremod, 
groupmod, etc. seem to vary considerably across Linux distros.

> add user script = /usr/sbin/adduser --ingroup domusers --gecos samba '%
> u'
> delete user script = /usr/sbin/deluser '%u'
> add group script = /usr/sbin/groupadd '%g'
> delete group script = /usr/sbin/groupdel '%g'
> add user to group script = /usr/sbin/adduser '%u' '%g'

Please note that the adduser script is entirely different from the useradd 
utility. Neither is consistent across implementations. Both vary from Linux 
distro to distro.  I was unaware of this until last week and am not sure how 
to handle this in the HOWTO, other than to make a note regarding the problem.

> add machine script = /usr/sbin/useradd -s /bin/false -d /var/lib/nobody
> '%u'
> now the adduser syntax gives me loads of this over and over again:
> Use of uninitialized value in chop at /usr/sbin/adduser line 537.
> Use of uninitialized value in pattern match (m//) at /usr/sbin/adduser
> line 538.
> Enter new UNIX password: Retype new UNIX password: No password supplied
> Enter new UNIX password: Retype new UNIX password: No password supplied
> Enter new UNIX password: Retype new UNIX password: No password supplied
> passwd: Authentication token manipulation error
> passwd: password unchanged
> If only all scripts would give me some hints why they don't work. As I
> see not for all scripts log entries but none work I think everything I
> tried was wrong.

This is something you will need to take up with the Linux distro maintainer.

> Could someone pinpoint me in the right direction or to the right part of
> the docs? Maybe some insights of how those scripts need to be built?

The useradd and adduser tools should NOT set the password. That whould be done 
using the passwd utility.

- John T.

More information about the samba mailing list