Re: "bulk" create of 400 users - Security

This is a discussion on Re: "bulk" create of 400 users - Security ; Michael Zawrotny wrote: > > Lew, > > On Tue, 29 Nov 2005 08:39:02 -0500, Lew Pitcher > wrote: >> >> You could use the newusers(8) command to build all your users in one >> batch. > > Learn something ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: Re: "bulk" create of 400 users

  1. Re: "bulk" create of 400 users

    Michael Zawrotny wrote:

    >
    > Lew,
    >
    > On Tue, 29 Nov 2005 08:39:02 -0500, Lew Pitcher
    > wrote:
    >>
    >> You could use the newusers(8) command to build all your users in one
    >> batch.

    >
    > Learn something new everyday. There was one thing that wasn't clear
    > to me from the man page that may or may not be important to the OP.
    > The man page says that pw_dir will be created if it doesn't exist and
    > it's ownership changed to that of the user. My question is whether or
    > not it populates a newly created directory with the contents of
    > /etc/skel the same way that useradd(8) does.
    >
    >
    > Mike
    >


    useradd does not do this automatically. Certain distributions have aliased
    useradd to "useradd -m" which does this operation. I would imagine you
    need to see what the default operation for useradd is. If it does not
    create the home with skel, then set up the alias and try again. By the way
    the man page reads, it calls useradd (proper), so an alias may do the
    trick.

  2. Re: "bulk" create of 400 users

    Ken K wrote:
    > Michael Zawrotny wrote:
    >
    > > On Tue, 29 Nov 2005 08:39:02 -0500, Lew Pitcher
    > > wrote:
    > >>
    > >> You could use the newusers(8) command to build all your users in one
    > >> batch.


    [ snip ]

    > > My question is whether or not it populates a newly created
    > > directory with the contents of /etc/skel the same way that
    > > useradd(8) does.

    >
    > useradd does not do this automatically. Certain distributions have aliased
    > useradd to "useradd -m" which does this operation.


    That's more-or-less what I meant, except that I wasn't concerned
    about the vendor supplied defaults and aliases.

    When I said that useradd copied the skeleton to the user's directory,
    I what I really meant was when invoked with "-m". My question was
    whether or not newusers(8) had that same capability.

    > By the way the man page reads, it calls useradd (proper), so an
    > alias may do the trick.


    Interesting. On the systems I have available (Ubuntu 5.x, old RH,
    and old Slackware), the only mention of useradd(8) is in the see also
    section. The man pages I have describe it as a sort of batch mode
    hybrid between useradd(8) and usermod(8) and give no indication of how
    it works.

    If newusers really calls useradd (in the fork/exec sense), then it
    wouldn't be noticeably more efficient than wrapping useradd in a shell
    loop (aside from the shell approach needing to compute the digest form
    of the password).


    Mike


    --
    Michael Zawrotny
    Institute of Molecular Biophysics
    Florida State University | email: zawrotny@sb.fsu.edu
    Tallahassee, FL 32306-4380 | phone: (850) 644-0069

+ Reply to Thread