2 .\" Copyright 1989 AT&T Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH ROLEADD 8 "Feb 25, 2017"
8 roleadd \- administer a new role account on the system
12 \fBroleadd\fR [\fB-c\fR \fIcomment\fR] [\fB-d\fR \fIdir\fR] [\fB-e\fR \fIexpire\fR] [\fB-f\fR \fIinactive\fR]
13 [\fB-g\fR \fIgroup\fR] [\fB-G\fR \fIgroup\fR [, \fIgroup\fR...]] [\fB-m\fR [\fB-k\fR \fIskel_dir\fR]]
14 [\fB-u\fR \fIuid\fR [\fB-o\fR]] [\fB-s\fR \fIshell\fR]
15 [\fB-A\fR \fIauthorization\fR [,\fIauthorization...\fR]] [\fB-K\fR \fIkey=value\fR] \fIrole\fR
20 \fBroleadd\fR \fB-D\fR [\fB-b\fR \fIbase_dir\fR] [\fB-e\fR \fIexpire\fR] [\fB-f\fR \fIinactive\fR]
21 [\fB-g\fR \fIgroup\fR] [\fB-A\fR \fIauthorization\fR [,\fIauthorization...\fR]]
22 [\fB-P\fR \fIprofile\fR [,\fIprofile...\fR] [\fB-K\fR \fIkey=value\fR]]
27 \fBroleadd\fR adds a role entry to the \fB/etc/passwd\fR and \fB/etc/shadow\fR
28 and \fB/etc/user_attr\fR files. The \fB-A\fR and \fB-P\fR options respectively
29 assign authorizations and profiles to the role. Roles cannot be assigned to
30 other roles. The \fB-K\fR option adds a \fIkey=value\fR pair to
31 \fB/etc/user_attr\fR for a role. Multiple \fIkey=value\fR pairs can be added
32 with multiple \fB-K\fR options.
35 \fBroleadd\fR also creates supplementary group memberships for the role
36 (\fB-G\fR option) and creates the home directory (\fB-m\fR option) for the role
37 if requested. The new role account remains locked until the \fBpasswd\fR(1)
41 Specifying \fBroleadd\fR \fB-D\fR with the \fB-g\fR, \fB-b\fR, \fB-f\fR,
42 \fB-e\fR, or \fB-K\fR option (or any combination of these option) sets the
43 default values for the respective fields. See the \fB-D\fR option. Subsequent
44 \fBroleadd\fR commands without the \fB-D\fR option use these arguments.
47 The system file entries created with this command have a limit of 512
48 characters per line. Specifying long arguments to several options can exceed
52 The role (\fBrole\fR) field accepts a string of no more than eight bytes
53 consisting of characters from the set of alphabetic characters, numeric
54 characters, period (\fB\&.\fR), underscore (\fB_\fR), and hyphen (\fB-\fR). The
55 first character should be alphabetic and the field should contain at least one
56 lower case alphabetic character. A warning message is written if these
57 restrictions are not met. A future Solaris release might refuse to accept role
58 fields that do not meet these requirements.
61 The \fBrole\fR field must contain at least one character and must not contain a
62 colon (\fB:\fR) or a newline (\fB\en\fR).
65 The following options are supported:
69 \fB\fB-A\fR \fIauthorization\fR\fR
72 One or more comma separated authorizations defined in \fBauth_attr\fR(4). Only
73 a user or role who has grant rights to the authorization can assign it to an
80 \fB\fB-b\fR \fIbase_dir\fR\fR
83 The default base directory for the system if \fB-d\fR\fI dir\fR is not
84 specified. \fIbase_dir\fR is concatenated with the account name to define the
85 home directory. If the \fB-m\fR option is not used, \fIbase_dir\fR must exist.
91 \fB\fB-c\fR \fIcomment\fR\fR
94 Any text string. It is generally a short description of the role. This
95 information is stored in the role's \fB/etc/passwd\fR entry.
101 \fB\fB-d\fR \fIdir\fR\fR
104 The home directory of the new role. It defaults to
105 \fIbase_dir\fR/\fIaccount_name\fR, where \fIbase_dir\fR is the base directory
106 for new login home directories and \fIaccount_name\fR is the new role name.
115 Display the default values for \fIgroup\fR, \fIbase_dir\fR, \fIskel_dir\fR,
116 \fIshell\fR, \fIinactive\fR, \fIexpire\fR and \fIkey=value\fR pairs. When used
117 with the \fB-g\fR, \fB-b\fR, \fB-f\fR, or \fB-K\fR, options, the \fB-D\fR
118 option sets the default values for the specified fields. The default values
127 \fBother\fR (\fBGID\fR of 1)
203 \fBkey=value (pairs defined in \fBuser_attr\fR(4)\fR
215 \fB\fB-e\fR \fIexpire\fR\fR
218 Specify the expiration date for a role. After this date, no user is able to
219 access this role. The expire option argument is a date entered using one of the
220 date formats included in the template file \fB/etc/datemsk\fR. See
223 If the date format that you choose includes spaces, it must be quoted. For
224 example, you can enter \fB10/6/90\fR or \fBOctober 6, 1990\fR. A null value
225 (\fB" "\fR) defeats the status of the expired date. This option is useful for
226 creating temporary roles.
232 \fB\fB-f\fR \fIinactive\fR\fR
235 The maximum number of days allowed between uses of a role ID before that ID is
236 declared invalid. Normal values are positive integers. A value of \fB 0\fR
243 \fB\fB-g\fR \fIgroup\fR\fR
246 An existing group's integer ID or character-string name. Without the \fB-D\fR
247 option, it defines the new role's primary group membership and defaults to the
248 default group. You can reset this default value by invoking \fBroleadd
249 \fR\fB-D\fR\fB \fR\fB-g\fR\fB \fR\fIgroup.\fR
255 \fB\fB-G\fR \fIgroup\fR\fR
258 An existing group's integer \fBID\fR or character-string name. It defines the
259 new role's supplementary group membership. Duplicates between \fIgroup\fR with
260 the \fB-g\fR and \fB-G\fR options are ignored. No more than \fBNGROUPS_MAX\fR
261 groups can be specified.
267 \fB\fB-k\fR \fIskel_dir\fR\fR
270 A directory that contains skeleton information (such as \fB\&.profile\fR) that
271 can be copied into a new role's home directory. This directory must already
272 exist. The system provides the \fB/etc/skel\fR directory that can be used for
279 \fB\fB-K\fR \fIkey=value\fR\fR
282 A \fIkey=value\fR pair to add to the role's attributes. Multiple \fB-K\fR
283 options can be used to add multiple \fIkey=value\fR pairs. The generic \fB-K\fR
284 option with the appropriate key can be used instead of the specific implied key
285 options (\fB-A\fR and \fB-P\fR). See \fBuser_attr\fR(4) for a list of valid
286 \fIkey=value\fR pairs. The "type" key is not a valid key for this option. Keys
296 Create the new role's home directory if it does not already exist. If the
297 directory already exists, it must have read, write, and execute permissions by
298 \fIgroup\fR, where \fIgroup\fR is the role's primary group.
307 This option allows a \fBUID\fR to be duplicated (non-unique).
313 \fB\fB-P\fR \fIprofile\fR\fR
316 One or more comma-separated execution profiles defined in \fBprof_attr\fR(4).
322 \fB\fB-s\fR \fIshell\fR\fR
325 Full pathname of the program used as the user's shell on login. It defaults to
326 an empty field causing the system to use \fB/bin/pfsh\fR as the default. The
327 value of \fIshell\fR must be a valid executable file.
333 \fB\fB-u\fR \fIuid\fR\fR
336 The \fBUID\fR of the new role. This \fBUID\fR must be a non-negative decimal
337 integer below \fBMAXUID\fR as defined in \fB<sys/param.h>\fR\&. The \fBUID\fR
338 defaults to the next available (unique) number above the highest number
339 currently assigned. For example, if \fBUID\fRs 100, 105, and 200 are assigned,
340 the next default \fBUID\fR number is 201. (\fBUID\fRs from \fB0\fR-\fB99\fR are
341 reserved for possible use in future applications.)
361 \fB/usr/include/limits.h\fR
367 See \fBattributes\fR(5) for descriptions of the following attributes:
375 ATTRIBUTE TYPE ATTRIBUTE VALUE
377 Interface Stability Evolving
382 \fBpasswd\fR(1), \fBpfsh\fR(1), \fBprofiles\fR(1), \fBroles\fR(1),
383 \fBusers\fR(1B), \fBgroupadd\fR(8), \fBgroupdel\fR(8), \fBgroupmod\fR(8),
384 \fBgrpck\fR(8), \fBlogins\fR(8), \fBpwck\fR(8), \fBuserdel\fR(8),
385 \fBusermod\fR(8), \fBgetdate\fR(3C), \fBauth_attr\fR(4), \fBpasswd\fR(4),
386 \fBprof_attr\fR(4), \fBuser_attr\fR(4), \fBattributes\fR(5)
389 In case of an error, \fBroleadd\fR prints an error message and exits with a
393 The following indicates that \fBlogin\fR specified is already in use:
397 UX: roleadd: ERROR: login is already in use. Choose another.
404 The following indicates that the \fIuid\fR specified with the \fB-u\fR option
409 UX: roleadd: ERROR: uid \fIuid\fR is already in use. Choose another.
416 The following indicates that the \fIgroup\fR specified with the \fB-g\fR option
421 UX: roleadd: ERROR: group \fIgroup\fR does not exist. Choose another.
428 The following indicates that the \fIuid\fR specified with the \fB-u\fR option
429 is in the range of reserved \fBUID\fRs (from \fB0\fR-\fB99\fR):
433 UX: roleadd: WARNING: uid \fIuid\fR is reserved.
440 The following indicates that the \fIuid\fR specified with the \fB-u\fR option
441 exceeds \fBMAXUID\fR as defined in \fB<sys/param.h>\fR:
445 UX: roleadd: ERROR: uid \fIuid\fR is too big. Choose another.
452 The following indicates that the \fB/etc/passwd\fR or \fB/etc/shadow\fR files
457 UX: roleadd: ERROR: Cannot update system files - login cannot be created.
464 If a network nameservice is being used to supplement the local
465 \fB/etc/passwd\fR file with additional entries, \fBroleadd\fR cannot change
466 information supplied by the network nameservice.