Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ANN] adduser-1.0



Creating new user accounts is hard, so I wrote a couple of tools. I considered using FreeBSD's adduser script, but it's a pretty nasty ball of perl, so I wrote it as Bourne shell script.

This allows you to create users and groups in a fairly straightforward manner, either in the flat files (default) or in a specified NetInfo domain. Usage info is below.

It should work on any BSD, but obviously it's meant for Darwin.

Prebuilt tarball, includes man pages:

http://www.freemethods.org/dist/adduser-1.0.tgz

Source repository:

http://svn.freemethods.org/trunk/Commands/adduser/

The source repository is on a WebDAV (actually, Subversion) server, so you can mount it in Finder and copy files that way.

Due to a bug in getopt(1), -n doesn't handle spaces, which is lame. Any sh scripting folks have suggestions, I could use some ideas there. getopt(1) implies this isn't easy to fix in getopt, but I think that's because they suggest you use $* instead of "$@" as an argument to getopt.

-wsv


Usage: adduser [-Viv] [-D domain] [-n name] [-m uid:gid]
[-u user[:id]] [-g group[:id]] [-G group[,...]] [-c class]
[-H dir] [-h home] [-s shell]
Options:
-V Print version and exit
-i Interactive mode, prompt for information
-v Be verbose
-D domain NetInfo domain to edit (instead of flat files)
-n name User's real name
-m uid:gid Minimum user and group ID when generating new IDs [1000:1000]
-u user User's login name
-u user:id User's login name and ID
-g group User's login group name [same as login name]
-g group:id User's login group name and ID
-G group,... User's group memberships [staff]
-c class User's login class []
-H dir Directory to place user's home directory into (overrides -h) [/Users]
-h home User's home directory (overrides -H)
-s shell User's login shell [/bin/tcsh]

Usage: addgroup [-hViv] [-D domain] [-m gid] [-g group[:id]] [-U user[,...]]
Options:
-h Print this help and exit
-V Print version and exit
-i Interactive mode, prompt for information
-v Be verbose
-D domain NetInfo domain to edit (instead of flat files)
-m gid Minimum group ID when generating new IDs [1000]
-g group:id Group's name and ID
-U user,... Group members
_______________________________________________
darwin-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-development
Do not post admin requests to the list. They will be ignored.


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.