[PLUG] adding user accounts in bulk

Zot O'Connor zot at whiteknighthackers.com
Mon Jan 5 17:59:02 UTC 2004


On Mon, 2004-01-05 at 15:21, Carla Schroder wrote:
> On Sunday 04 January 2004 9:11 am, Michael Rasmussen wrote:
> > 
> > On Sat, Jan 03, 2004 at 04:30:22PM -0800, Jeme A Brelin wrote:
> > > Rather,
> > > useradd -m -k /etc/skel -p $PASSWORD $USERNAME

man useradd

 -m     The  userâs home directory will be created if it does not exist.
        The files contained in skeleton_dir will be copied to the  home
        directory  if  the  -k  option is used, otherwise the files
        contained in /etc/skel will be used instead.  Any directories 
        contained  in  skeleton_dir  or  /etc/skel  will  be created in
        the user's home directory as well.  The -k option is only 
        valid  in conjunction  with  the  -m option.  The default is to
        not create the directory and to not copy any files.

so the -k seems redundant 
-p passwd
              The encrypted password, as returned by crypt(3).  The
default is to disable the account

So you need to loop $password and $username 

Off course you can leave off -m if according to -M

-M     The user home directory will not be created, even if the  system
              wide settings from /etc/login.defs is to create home dirs.

of course group adding was a redhat thing:

     -n     A group having the same name as the user being added to the
system will be created by default. This option will turn  off  thisRed
Hat Linux specific behavior.



-- 
Zot O'Connor

http://www.ZotConsulting.com
http://www.WhiteKnightHackers.com





More information about the PLUG mailing list