The following options are supported:
One or more comma separated authorizations as defined in
. Only a user or role who has grant
rights to the
can assign it to an account. This replaces any existing
authorization setting. If an empty authorization list is specified, the
existing setting is removed.
Specify a comment string. comment can be any text
string. It is generally a short description of the login, and is currently
used as the field for the role's full name. This information is stored in the
role's /etc/passwd entry.
Specify the new home directory of the role. It defaults
to base_dir/login, where base_dir is the base directory for new
login home directories, and login is the new login.
Specify the expiration date for a role. After this date,
no role will be able to access this login. The expire option argument is a
date entered using one of the date formats included in the template file
. See getdate(3C)
For example, you may enter 10/6/90 or October 6,
1990. A value of `` '' defeats the status of the expired
Specify the maximum number of days allowed between uses
of a login ID before that login ID is declared invalid. Normal
values are positive integers. A value of 0 defeats the status.
Specify an existing group's integer ID or
character-string name. It redefines the role's primary group membership.
One or more comma-separated existing groups, specified by
integer ID or character-string name. It redefines the role's
supplementary group membership. Any duplicate groups between the -g and
-G options are ignored. No more than NGROUPS_UMAX groups may be
specified as defined in <sys/param.h>.
Replace existing or add to a role's key=value
attributes. Multiple -K
options can be used to replace or add multiple
pairs. However, keys must not be repeated. The generic
option with the appropriate key may be used instead of the specific
implied key options (-A
). See user_attr(5)
list of valid key=value
The keyword type can be specified with the value
role or the value normal. When using the value normal,
the account changes from a role user to a normal user; using the value
role keeps the account a role user.
Specify the new login name for the role. The
new_logname argument is a string of no more than eight bytes consisting
of characters from the set of alphabetic characters, numeric characters,
period (.), underline (_), and hyphen (−). The
first character should be alphabetic and the field should contain at least one
lower case alphabetic character. A warning message will be written if these
restrictions are not met. A future release may refuse to accept login fields
that do not meet these requirements. The new_logname argument must
contain at least one character and must not contain a colon (:) or
Move the role's home directory to the new directory
specified with the -d
option. If the directory already exists, it must
have permissions read/write/execute by group
, where group
role's primary group.
If the role's old home directory was located on a separate
ZFS file system and the /etc/default/useradd file contains the
parameter MANAGE_ZFS set to the value YES, the file system
will be destroyed after the home directory is moved. If the parent directory
of the role's new home directory is located on a separate ZFS
filesystem and the /etc/default/useradd file contains the parameter
MANAGE_ZFS set to the value YES, a new ZFS file system
will be created.
If the -z option is specified, rolemod will always
try to create a new file system for the home directory and destroy the old
If the -Z option is specified, a new file system will never
be created, and the old one will never be destroyed.
This option allows the specified UID to be
One or more comma-separated execution profiles defined in
. This replaces any existing profile setting. If an empty
profile list is specified, the existing setting is removed.
Specify the full pathname of the program that is used as
the role's shell on login. The value of shell must be a valid
In case of an error, rolemod prints an error message and exits with one
of the following values:
Specify a new UID
for the role. It must be a
non-negative decimal integer less than MAXUID
as defined in
. The UID
associated with the role's home
directory is not modified with this option; a role will not have access to
their home directory until the UID
is manually reassigned using
The command syntax was invalid. A usage message for the
rolemod command is displayed.
An invalid argument was provided to an option.
The uid given with the -u option is already
The password files contain an error. pwconv(8)
be used to correct possible errors. See passwd(5)
The login to be modified does not exist, the group
does not exist, or the login shell does not exist.
The login to be modified is in use.
The new_logname is already in use.
Cannot update the /etc/group or
/etc/user_attr file. Other update requests will be implemented.
Insufficient space to move the home directory (-m
option). Other update requests will be implemented.
Unable to complete the move of the home directory to the
new home directory.