admuseradd(1M)

NAME
admuseradd - adds a new user entry to the password database

SYNOPSIS

admuseradd -u uid [-c comment] [-d dir] [-e expire]
[-f inactive] [-g group] [-G group1 [,group2...]]
[-m [-k skel_dir]] [-s shell]
[-x ns=NIS+|NIS|NONE] [-x serv=server]
[-x perm=home_perm] [-x pw=CLR|LOCK|NONE|NORM]
[-x passwd=password] [-x pwmin=days]
[-x pwmax=days] [-x pwwarn=days]
[-x mail=mail_server] [-x autohome=Y|N]
[-x cred=Y|N] [-x domain=domain|rhost=host]
[-x preadd=script] [-x postadd=script]
login

admuseradd -D [-b basedir] [-e expire] [-f inactive]
[-g group] [-G group1 [,group2...]] [-k skel_dir]
[-s shell] [-x createhd=Y|N] [-x serv=server]
[-x perm=home_perm] [-x pw=CLR|LOCK|NONE|NORM]
[-x pwmin=days] [-x pwmax=days] [-x pwwarn=days]
[-x mail=mail_server] [-x autohome=Y|N]
[-x cred=Y|N] [-x ns=NIS+|NIS|NONE]
[-x domain=domain|rhost=host]

DESCRIPTION
The Solstice admuseradd command adds a new user entry to the password database and optionally sets up a new home directory and mail file. The system file entries created with this command have a limit of 512 characters per line. Specifying long arguments to several options may exceed this limit. A string of printable characters that specifies the new login name of the user, up to a maximum of eight characters. It may not contain a colon (:) or a new line (\n). Specifying admuseradd -D with one of its additional options sets the default values for the respective fields. See the -D option below. Subsequent admuseradd commands use these values as the default.

AVAILABILITY

SUNWsadmb package.

OPTIONS

-u uid
    Specifies the user ID (UID) of the new user.

-c comment
    A string comprised of printable characters, excluding the colon character (:). comment is a short description of the login, which is typically the user's name.

-d dir
    The home directory of the new user. This field is limited to 1024 characters, as defined in PATH_MAX in /usr/include/limits.h. If the -m option is not specified and the path prefix does not exist, admuseradd issues a warning but adds the directory information to the password database (provided the command does not fail). If the path prefix does not exist and the -m option is specified, admuseradd fails and issues an error message.

-e expire
    Specifies the expiration date for a login. After this date, no user will be able to access this login. Not available if name service is NIS. expire is a date specified either in a format that is appropriate for the locale you are in or the generic format yyyy-mm-dd. This option is useful for creating temporary logins. A null value (" ") means the login is always valid.

-f inactive
    The maximum number of days allowed between uses of a login ID before that login ID is declared invalid. Normal values are positive integers. Not available if name service is NIS. A value of 0 means the login account is always active.

-g group
    An existing group's integer ID or character-string name. It defines the new user's primary group membership in the system group database.

-G group1[,group2...]
    The integer IDs or character-string names of one or more existing groups, that define the new user's supplementary group membership in the system group database. Duplicates of groups specified with the -g and -G options are ignored.

-m  Creates the new user's home directory (as specified with the -d option) if it does not already exist.

-k skel_dir
    An existing directory that contains skeleton information (such as .profile) that can be copied into a new user's home directory. The system provides the /etc/skel directory that can be used for this purpose.

-s shell
    Full pathname of the program used as the user's shell on login. The field is limited to 1024 characters, as defined in PATH_MAX in /usr/include/limits.h. It defaults to an empty field, causing the system to use /sbin/sh as the default. The value of shell must be a valid, executable file.

-x  Indicates that extended, nonstandard options follow.

    ns=NIS+|NIS|NONE
        Sets name service. The default is to use the name service configured on the host on which the command is run. The precedence is NIS+, NIS, then NONE.

        NIS+
            Updates the NIS+ user tables for the current domain.

        NIS Updates the NIS user tables for the current domain.

        NONE
            Updates the local user files in /etc.

    serv=server
        The name of the server where the home directory will reside. Used only if the -m option is specified.

    perm=home_perm
        The permissions on the new home directory. perm is interpreted as an octal number (the same as in the chmod command). The default is 0775.

    pw=CLR|LOCK|NONE|NORM
        The initial password type for this account.
        CLR
            Cleared until first login. The account will not have a password. Since there is no password, anybody can log in as this user.

        LOCK
            Account is locked. The user will not be able to log in until the administrator assigns a password.

        NONE
            No valid password. The account is locked and is setuid only.

        NORM
            Normal password. The password will be set to either the value of the passwd parameter, or admuseradd will prompt for a password if the passwd parameter is not provided.

    passwd=password
        The password to assign to the account when the pw value is NORM. The value can contain no more than eight characters. If this option is not used and the type is NORM, then admuseradd will interactively prompt for a password and confirmation. Note that specifying the password as a parameter to the command introduces a security hole while the command is running.

    pwmin=days
        Minimum number of days between password changes. Not available if name service is NIS.

    pwmax=days
        Maximum number of days that this password is valid. Not available if name service is NIS.

    pwwarn=days
        Number of days relative to pwmax that the user will be warned about password expiration. Not available if name service is NIS.

    mail=mail_server
        Host name of the mail server for this account. If set, a mail file will be created on the server.

    autohome=Y|N
        Sets up the home directory to be automounted if set to Y. The user's home directory path in the password entry will be set to /home followed by the user's login name.

    cred=Y|N
        Specifies whether to create a NIS+ security entry for the user. This option can only be used when the name service is NIS+.

    preadd=script
        Specifies a script to execute prior to adding the user. The script must reside in the /opt/SUNWadmd/Scripts directory and must have execute permission.

    postadd=script
        Specifies a script to execute after adding the user. The script must reside in the /opt/SUNWadmd/Scripts directory and must have execute permission. The following environment variables are available to the scripts:

        ADM_OPERATION
            The administrative operation for which this script is being called, in this case it is either PREADD or POSTADD.

        ADM_USER_LOGIN_NAME
            The user's login name.

        ADM_USER_UID
            The user ID (UID) of the user.

        ADM_USER_PRIMARY_GROUP
            A group's integer ID or character-string name. It defines the user's primary group member-ship in the system group database.

        ADM_USER_SECONDARY_GROUPS
            The integer IDs or character-string names of one or more existing groups, that define the new user's supplementary group membership in the system group database.

        ADM_USER_SHELL
            Full pathname of the program used as the user's shell on login.

        ADM_USER_SERVER
            The name of the server where the home directory will reside.

        ADM_USER_HOMEPATH
            The path to the user's home directory.

        ADM_USER_FILEMODE
            The permissions on the new home directory.

        ADM_USER_MAILPATH
            The path to the user's mail file.

        ADM_USER_MAIL_SERVER
            The host name of the mail server for this user account.

        ADM_USER_PASSWORD_CATEGORY
            The initial password type for this account.

        ADM_USER_INACTIVE_PERIOD
            The maximum number of days allowed between uses of a login ID before that login ID is declared invalid.

        ADM_USER_ACCOUNT_EXPIRATION
            The expiration date for a login.

        ADM_USER_AUTOMOUNT_HOME
            This indicates whether the user home directory has an entry in /etc/auto_home.

        ADM_USER_NAMESERVICE
            The name service used to perform this operation.

        ADM_USER_NISPLUS_CREDENTIAL
            Whether the user will have a NIS+ security entry.

        ADM_USER_SKELETON_PATH
            The path to the directory containing the skeleton files used as templates for the .login, .cshrc and .profile files.

    domain=domain|rhost=host
        Specifies domain or remote host. The domain can be specified when the value for the ns parameter is NIS+ or NIS. The domain defaults to the current system domain. The rhost can be specified when the value for the ns parameter is NONE. The rhost defaults to the current system. The rhost parameter can be used to perform the operation on the specified host. The machine specified as an argument to rhost must be running AdminSuite 2.1 or later for the command to complete successfully.

login
    A string of printable characters that specifies the new login name of the user, up to a maximum of eight characters. It may not contain a colon (:) or a newline (\n). The new login remains locked until the passwd(1) command is executed.

-D
    When specified with no other options, displays the default values that will be used when creating a new user. When used with one of the additional options, the -D option sets the default value for the specified fields. Using the ns, domain, and rhost parameters with -D does not set the default for these parameters, but instead specifies where the defaults are to be found or saved. The display format shows each key/value on a separate line. The key name is delimited from the value by a colon (:). For example,
    Primary Group: 10
    The current keys are Primary Group, Secondary Groups, Shell, Password, Min Change, Max Change, Max Inactive, Expiration Date, Warning, Create Home Dir, Server, Base Dir, Skeleton Path, AutoHome Setup, Permissions, and Mail Server. Additional keys for new defaults may be added in the future, so a script using this command should not depend on just these keys as output of the -D option.

-b basedir
    The default base directory for the system if -d dir is not specified. basedir is concatenated with the user's login to define the home directory. If the -m option is not used, basedir must exist.

-x createhd=Y|N
    Sets the default value for creating the users home directory. If the -m option is not used, the user's home directory will be created if createhd is set to Y.

ENVIRONMENT

See environ(5) for descriptions of the following environment variables that affect the execution of admuseradd: LANG, LC_ALL, LC_CTYPE, and LC_MESSAGES.

ERRORS

The admuseradd command exits with one of the following values:

0   Success.

1   Invalid command syntax. A usage message for the admuseradd command is displayed.

2   An error occurred while executing the command. An exception code and error message are displayed.

RESTRICTIONS
You must be a member of UNIX group 14, the sysadmin group, to execute this command. Also, if ns=NIS+, you must be a member of the NIS+ admin group (See nisgrpadm(1)). Interrupt signal handling is disabled while adding the user to insure that the system is in a consistent state.

EXAMPLES
The following command sets up a user account according to the following:

Sets UID 456.

Sets GID 10.

Sets password to be clear until the first login.

Sets the server for the user's home directory to server.

Sets the name of the new user account to newuser.
    admuseradd -u 456 -g 10 -x pw=CLR serv=server newuser

FILES
/etc/passwd
/etc/shadow
/etc/group
/etc/auto_home
/etc/skel
/opt/SUNWadmd/Scripts

SEE ALSO
admuserdel(1M), admuserls(1M), admusermod(1M)