[Samba] SWAT adduser problem

Tom Duerbusch DuerbuschT at stlouiscity.com
Fri Apr 22 14:15:39 MDT 2011

I have Samba installed on Linux and brought up the SWAT.  This is on SLES 11 SP 1.

Should be easy.

I tried using the default "adduser" script (adduser.local).
I do see that I'm executing it.  (I put an "echo" in it.)
However, it seems to only get 1 parm, which is the user to add.

The script shows that it uses up to 4 parms:
username uid gid home

But no matter what I put in the SWAT Global options, the last 3 parms don't seem to be populated.

Just to see if I was limited to 1 parm, I put the following in:

/usr/sbin/useradd.local %u %g %u %u

In the adduser.local, the echo line I put in is:
echo 'thdon' $1 $2 $3 $4 'thdoff'

What I got back when I was in the "Password" button, and did a "Add New User" was:

thdon tom10 %g tom10 tom10 thdoff skip tests 2 Failed to add entry for user tom10.

So, "thdon" is start of my echo.
tom10 is the user I'm trying to create.
%g was suppose to be a symbolic parm that I thought would be resolved by swat to be the group this user should be in.
The other two "tom10" was just place holders to see that SWAT was passing 4 parms to the script.
"thdoff" was the end of my echo.

The next echo in the script was:
echo 'skip tests 2'
which showed how far I got down in the script.

"Faild to add entry for user", I recognize as an error message that comes from the smbpasswd command.  That command, nor the linux "useradd" command are not part of this script.  I don't know where, under the covers, I'm executing anything else.

So, my question is:
What parms are available in swat to pass thru to the "useradd" script?
%u seems to work.  But none of the others that are listed in the smb.conf documentation.

I would rather have SWAT available rather than teach the administrator how to use the line mode commands to add users.


Tom Duerbusch
THD Consulting

More information about the samba mailing list