Subject: Re: Can't find 'adduser' on 1.3(i386)
To: None <scott@lackluster.net>
From: Simon J. Gerraty <sjg@quick.com.au>
List: port-i386
Date: 01/05/1998 14:31:33
>On Mon, Jan 05, 1998 at 12:32:21AM +0100, Peter Simons wrote:
>>  > (Along with a supposedly nice script to perform said task.)
>> 
>> I can't recommend the script that is advertised in the *BSD FAQ at
>> all. I once tried it and found that customizing that script to my
>> needs by far exceeds the time it takes to add, say, 10-20 users
>> manually.
>> 

>Now you know why I said `supposedly.'  :)
>I tried it, and found it to be a pain, too, but I didn't mess with it much.

Strange, that script has been downloaded 100s of times in the last few years,
and no one has aver complained to me about it... perhaps no one
actually uses it :-)

Running vipw a few times is easier than learning anything
and generic tools are probably the worst.  I've never botherd putting
too much user freindly in it as most sites simply create a .adduserrc
in say /etc and optionally another one in the directory where the
home dir will be created (default is /home/$host) so you can have 
different defaults for different groups of users (I use /home/$group
for the parent of home dirs).

For example, 

# cat /home/ext/.adduserrc
Shell=/bin/ksh
Group=ext
uid=9000
Passwd=11tRy17gmFhBI
PW_AGE=immediate
list=yes

# adduser.sh -H /home/ext
Defaults:
        Group=ext
        Homes=/home/ext
        Shell=/bin/ksh
        Passwd=11tRy17gmFhBI
        Initial uid=9000

Enter username and fullname - spaces in fullname are ok, no quotes needed.
An empty line terminates input.

username fullname: x1235 Fred Nerk
adding x1235:11tRy17gmFhBI:9003:9000:Fred Nerk:/home/ext/x1235:/bin/ksh to /etc/passwd
locking /etc/passwd 
username fullname: 
#

adds the user (and if /home/ext/default exists, its content would have been
replicated into the new dir) and sets the passwd to expire immediately.

I have (somewhere) an incredibly user friendly add user script which was aimed
at non-unix savvy operators (had on-line help etc etc).  I wrote it nearly
10 years ago and haven't used it in almost as long as I rarely work
places where adduser.sh is inadequate (once set up of course).

Would a few examples in the man page help?

One of the most common usages here (where I'm sitting that is) is:

adduser.sh x1235:11tRy17gmFhBI:9003:9000:Fred Nerk:/home/ext/x1235:/bin/ksh

which will creat that account (regardless of what the actual /etc/passwd 
format is) and is used for replicating essential accounts on new systems
regardless of whether they run SunOS,Solaris,HP-UX or NetBSD etc.

You can add a -f option to force it to use the uid etc even if duplicate,
handy for adding multiple su accounts.

Anyway, if you have constructive critisism, feel free to e-mail me.

--sjg