293 useradd/del/mod should be ZFS-aware
[illumos-gate.git] / usr / src / man / man1m / passmgmt.1m
blobf654f4d015d275c18682a8de03cbf5fa4cd44f83
1 '\" te
2 .\"  Copyright 1989 AT&T Copyright (c) 2007 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 PASSMGMT 1M "Aug 27, 2007"
7 .SH NAME
8 passmgmt \- password files management
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fBpassmgmt\fR \fB-a\fR \fIoptions\fR \fIname\fR
13 .fi
15 .LP
16 .nf
17 \fBpassmgmt\fR \fB-m\fR \fIoptions\fR \fIname\fR
18 .fi
20 .LP
21 .nf
22 \fBpassmgmt\fR \fB-d\fR \fIname\fR
23 .fi
25 .SH DESCRIPTION
26 .sp
27 .LP
28 The \fBpassmgmt\fR command updates information in the password files. This
29 command works with both \fB/etc/passwd\fR and \fB/etc/shadow\fR.
30 .sp
31 .LP
32 \fBpassmgmt\fR \fB-a\fR adds an entry for user \fIname\fR to the password
33 files. This command does not create any directory for the new user and the new
34 login remains locked (with the string \fB*LK*\fR in the password field) until
35 the \fBpasswd\fR(1) command is executed to set the password.
36 .sp
37 .LP
38 \fBpassmgmt\fR \fB-m\fR modifies the entry for user \fIname\fR in the password
39 files. The name field in the \fB/etc/shadow\fR entry and all the fields (except
40 the password field) in the \fB/etc/passwd\fR entry can be modified by this
41 command. Only fields entered on the command line will be modified.
42 .sp
43 .LP
44 \fBpassmgmt\fR \fB-d\fR deletes the entry for user \fIname\fR from the password
45 files. It will not remove any files that the user owns on the system; they must
46 be removed manually.
47 .sp
48 .LP
49 \fBpassmgmt\fR can be used only by the super-user.
50 .SH OPTIONS
51 .sp
52 .ne 2
53 .na
54 \fB\fB\fR\fB-c\fR \fIcomment\fR\fR
55 .ad
56 .RS 16n
57 A short description of the login, enclosed in quotes. It is limited to a
58 maximum of 128 characters and defaults to an empty field.
59 .RE
61 .sp
62 .ne 2
63 .na
64 \fB\fB-e\fR \fIexpire\fR\fR
65 .ad
66 .RS 16n
67 Specify the expiration date for a login. After this date, no user will be able
68 to access this login. The expire option argument is a date entered using one of
69 the date formats included in the template file \fB/etc/datemsk\fR. See
70 \fBgetdate\fR(3C).
71 .RE
73 .sp
74 .ne 2
75 .na
76 \fB\fB-f\fR \fIinactive\fR\fR
77 .ad
78 .RS 16n
79 The maximum number of days allowed between uses of a login ID before that
80 \fBID\fR is declared invalid. Normal values are positive integers. A value of
81 \fB0\fR defeats the status.
82 .sp
83 Changing the password reactivates an account for the inactivity period.
84 .RE
86 .sp
87 .ne 2
88 .na
89 \fB\fB\fR\fB-g\fR \fIgid\fR\fR
90 .ad
91 .RS 16n
92 \fBGID\fR of \fIname\fR. This number must range from 0 to the maximum
93 non-negative value for the system. The default is 1.
94 .RE
96 .sp
97 .ne 2
98 .na
99 \fB\fB\fR\fB-h\fR \fIhomedir\fR\fR
101 .RS 16n
102 Home directory of \fIname\fR. It is limited to a maximum of 256 characters and
103 defaults to \fB/usr/\fR\fIname\fR.
107 .ne 2
109 \fB\fB-K\fR \fIkey=value\fR\fR
111 .RS 16n
112 Set a \fIkey=value\fR pair. See \fBuser_attr\fR(4), \fBauth_attr\fR(4), and
113 \fBprof_attr\fR(4). The valid \fIkey=value\fR pairs are defined in
114 \fBuser_attr\fR(4), but the "type" key is subject to the \fBusermod\fR(1M) and
115 \fBrolemod\fR(1M) restrictions. Multiple \fIkey=value\fR pairs may be added
116 with multiple \fB-K\fR options.
120 .ne 2
122 \fB\fB-k\fR \fIskel_dir\fR\fR
124 .RS 16n
125 A directory that contains skeleton information (such as \fB\&.profile\fR) that
126 can be copied into a new user's home directory. This directory must already
127 exist. The system provides the \fB/etc/skel\fR directory that can be used for
128 this purpose.
132 .ne 2
134 \fB\fB-l\fR \fIlogname\fR\fR
136 .RS 16n
137 This option changes the \fIname\fR to \fIlogname\fR. It is used only with the
138 \fB-m\fR option. The total size of each login entry is limited to a maximum of
139 511 bytes in each of the password files.
143 .ne 2
145 \fB\fB-o\fR\fR
147 .RS 16n
148 This option allows a \fBUID\fR to be non-unique. It is used only with the
149 \fB-u\fR option.
153 .ne 2
155 \fB\fB\fR\fB-s\fR \fIshell\fR\fR
157 .RS 16n
158 Login shell for \fIname\fR. It should be the full pathname of the program that
159 will be executed when the user logs in. The maximum size of \fIshell\fR is 256
160 characters. The default is for this field to be empty and to be interpreted as
161 \fB/usr/bin/sh\fR.
165 .ne 2
167 \fB\fB\fR\fB-u\fR \fIuid\fR\fR
169 .RS 16n
170 \fBUID\fR of the \fIname\fR. This number must range from 0 to the maximum
171 non-negative value for the system. It defaults to the next available \fBUID\fR
172 greater than 99. Without the \fB-o\fR option, it enforces the uniqueness of a
173 \fBUID.\fR
176 .SH FILES
178 .in +2
180 \fB/etc/passwd\fR
181 \fB/etc/shadow\fR
182 \fB/etc/opasswd\fR
183 \fB/etc/oshadow\fR              
185 .in -2
188 .SH ATTRIBUTES
191 See \fBattributes\fR(5) for descriptions of the following attributes:
196 box;
197 c | c
198 l | l .
199 ATTRIBUTE TYPE  ATTRIBUTE VALUE
201 Interface Stability     Evolving
204 .SH SEE ALSO
207 \fBpasswd\fR(1), \fBrolemod\fR(1M), \fBuseradd\fR(1M), \fBuserdel\fR(1M),
208 \fBusermod\fR(1M), \fBauth_attr\fR(4), \fBpasswd\fR(4), \fBprof_attr\fR(4),
209 \fBshadow\fR(4), \fBuser_attr\fR(4), \fBattributes\fR(5)
210 .SH EXIT STATUS
213 The \fBpassmgmt\fR command exits with one of the following values:
215 .ne 2
217 \fB\fB0\fR\fR
219 .RS 5n
220 Success.
224 .ne 2
226 \fB\fB1\fR\fR
228 .RS 5n
229 Permission denied.
233 .ne 2
235 \fB\fB2\fR\fR
237 .RS 5n
238 Invalid command syntax. Usage message of the \fBpassmgmt\fR command is
239 displayed.
243 .ne 2
245 \fB\fB3\fR\fR
247 .RS 5n
248 Invalid argument provided to option.
252 .ne 2
254 \fB\fB4\fR\fR
256 .RS 5n
257 UID in use.
261 .ne 2
263 \fB\fB5\fR\fR
265 .RS 5n
266 Inconsistent password files (for example, \fIname\fR is in the
267 \fB/etc/passwd\fR file and not in the \fB/etc/shadow\fR file, or vice versa).
271 .ne 2
273 \fB\fB6\fR\fR
275 .RS 5n
276 Unexpected failure. Password files unchanged.
280 .ne 2
282 \fB\fB7\fR\fR
284 .RS 5n
285 Unexpected failure. Password file(s) missing.
289 .ne 2
291 \fB\fB8\fR\fR
293 .RS 5n
294 Password file(s) busy. Try again later.
298 .ne 2
300 \fB\fB9\fR\fR
302 .RS 5n
303 \fIname\fR does not exist (if \fB-m\fR or \fB-d\fR is specified), already
304 exists (if \fB-a\fR is specified), or \fBlogname\fR already exists (if
305 \fB\fR\fB-m\fR \fB-l\fR is specified).
308 .SH NOTES
311 Do not use a colon (\fB:\fR) or \fBRETURN\fR as part of an argument. It is
312 interpreted as a field separator in the password file. The \fBpassmgmt\fR
313 command will be removed in a future release. Its functionality has been
314 replaced and enhanced by \fBuseradd\fR, \fBuserdel\fR, and \fBusermod\fR. These
315 commands are currently available.
318 This command only modifies password definitions in the local \fB/etc/passwd\fR
319 and \fB/etc/shadow\fR files. If a network nameservice such as \fBNIS\fR or
320 \fBNIS+\fR is being used to supplement the local files with additional entries,
321 \fBpassmgmt\fR cannot change information supplied by the network nameservice.