summaryrefslogtreecommitdiff
path: root/usr/src/man/man1m/passmgmt.1m
blob: 7c6f210dbe9c5a7b48ebca1ce0d1000390731a7d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
'\" te
.\"  Copyright 1989 AT&T Copyright (c) 2007 Sun Microsystems, Inc. All Rights Reserved.
.\" 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.
.\" 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.
.\" 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]
.TH PASSMGMT 1M "Feb 25, 2017"
.SH NAME
passmgmt \- password files management
.SH SYNOPSIS
.LP
.nf
\fBpassmgmt\fR \fB-a\fR \fIoptions\fR \fIname\fR
.fi

.LP
.nf
\fBpassmgmt\fR \fB-m\fR \fIoptions\fR \fIname\fR
.fi

.LP
.nf
\fBpassmgmt\fR \fB-d\fR \fIname\fR
.fi

.SH DESCRIPTION
.LP
The \fBpassmgmt\fR command updates information in the password files. This
command works with both \fB/etc/passwd\fR and \fB/etc/shadow\fR.
.sp
.LP
\fBpassmgmt\fR \fB-a\fR adds an entry for user \fIname\fR to the password
files. This command does not create any directory for the new user and the new
login remains locked (with the string \fB*LK*\fR in the password field) until
the \fBpasswd\fR(1) command is executed to set the password.
.sp
.LP
\fBpassmgmt\fR \fB-m\fR modifies the entry for user \fIname\fR in the password
files. The name field in the \fB/etc/shadow\fR entry and all the fields (except
the password field) in the \fB/etc/passwd\fR entry can be modified by this
command. Only fields entered on the command line will be modified.
.sp
.LP
\fBpassmgmt\fR \fB-d\fR deletes the entry for user \fIname\fR from the password
files. It will not remove any files that the user owns on the system; they must
be removed manually.
.sp
.LP
\fBpassmgmt\fR can be used only by the super-user.
.SH OPTIONS
.ne 2
.na
\fB\fB\fR\fB-c\fR \fIcomment\fR\fR
.ad
.RS 16n
A short description of the login, enclosed in quotes. It is limited to a
maximum of 128 characters and defaults to an empty field.
.RE

.sp
.ne 2
.na
\fB\fB-e\fR \fIexpire\fR\fR
.ad
.RS 16n
Specify the expiration date for a login. After this date, no user 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 \fB/etc/datemsk\fR. See
\fBgetdate\fR(3C).
.RE

.sp
.ne 2
.na
\fB\fB-f\fR \fIinactive\fR\fR
.ad
.RS 16n
The maximum number of days allowed between uses of a login ID before that
\fBID\fR is declared invalid. Normal values are positive integers. A value of
\fB0\fR defeats the status.
.sp
Changing the password reactivates an account for the inactivity period.
.RE

.sp
.ne 2
.na
\fB\fB\fR\fB-g\fR \fIgid\fR\fR
.ad
.RS 16n
\fBGID\fR of \fIname\fR. This number must range from 0 to the maximum
non-negative value for the system. The default is 1.
.RE

.sp
.ne 2
.na
\fB\fB\fR\fB-h\fR \fIhomedir\fR\fR
.ad
.RS 16n
Home directory of \fIname\fR. It is limited to a maximum of 256 characters and
defaults to \fB/usr/\fR\fIname\fR.
.RE

.sp
.ne 2
.na
\fB\fB-K\fR \fIkey=value\fR\fR
.ad
.RS 16n
Set a \fIkey=value\fR pair. See \fBuser_attr\fR(4), \fBauth_attr\fR(4), and
\fBprof_attr\fR(4). The valid \fIkey=value\fR pairs are defined in
\fBuser_attr\fR(4), but the "type" key is subject to the \fBusermod\fR(1M) and
\fBrolemod\fR(1M) restrictions. Multiple \fIkey=value\fR pairs may be added
with multiple \fB-K\fR options.
.RE

.sp
.ne 2
.na
\fB\fB-k\fR \fIskel_dir\fR\fR
.ad
.RS 16n
A directory that contains skeleton information (such as \fB\&.profile\fR) that
can be copied into a new user's home directory. This directory must already
exist. The system provides the \fB/etc/skel\fR directory that can be used for
this purpose.
.RE

.sp
.ne 2
.na
\fB\fB-l\fR \fIlogname\fR\fR
.ad
.RS 16n
This option changes the \fIname\fR to \fIlogname\fR. It is used only with the
\fB-m\fR option. The total size of each login entry is limited to a maximum of
511 bytes in each of the password files.
.RE

.sp
.ne 2
.na
\fB\fB-o\fR\fR
.ad
.RS 16n
This option allows a \fBUID\fR to be non-unique. It is used only with the
\fB-u\fR option.
.RE

.sp
.ne 2
.na
\fB\fB\fR\fB-s\fR \fIshell\fR\fR
.ad
.RS 16n
Login shell for \fIname\fR. It should be the full pathname of the program that
will be executed when the user logs in. The maximum size of \fIshell\fR is 256
characters. The default is for this field to be empty and to be interpreted as
\fB/usr/bin/sh\fR.
.RE

.sp
.ne 2
.na
\fB\fB\fR\fB-u\fR \fIuid\fR\fR
.ad
.RS 16n
\fBUID\fR of the \fIname\fR. This number must range from 0 to the maximum
non-negative value for the system. It defaults to the next available \fBUID\fR
greater than 99. Without the \fB-o\fR option, it enforces the uniqueness of a
\fBUID.\fR
.RE

.SH FILES
.in +2
.nf
\fB/etc/passwd\fR
\fB/etc/shadow\fR
\fB/etc/opasswd\fR
\fB/etc/oshadow\fR		
.fi
.in -2
.sp

.SH ATTRIBUTES
.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Evolving
.TE

.SH SEE ALSO
.LP
\fBpasswd\fR(1), \fBrolemod\fR(1M), \fBuseradd\fR(1M), \fBuserdel\fR(1M),
\fBusermod\fR(1M), \fBauth_attr\fR(4), \fBpasswd\fR(4), \fBprof_attr\fR(4),
\fBshadow\fR(4), \fBuser_attr\fR(4), \fBattributes\fR(5)
.SH EXIT STATUS
.LP
The \fBpassmgmt\fR command exits with one of the following values:
.sp
.ne 2
.na
\fB\fB0\fR\fR
.ad
.RS 5n
Success.
.RE

.sp
.ne 2
.na
\fB\fB1\fR\fR
.ad
.RS 5n
Permission denied.
.RE

.sp
.ne 2
.na
\fB\fB2\fR\fR
.ad
.RS 5n
Invalid command syntax. Usage message of the \fBpassmgmt\fR command is
displayed.
.RE

.sp
.ne 2
.na
\fB\fB3\fR\fR
.ad
.RS 5n
Invalid argument provided to option.
.RE

.sp
.ne 2
.na
\fB\fB4\fR\fR
.ad
.RS 5n
UID in use.
.RE

.sp
.ne 2
.na
\fB\fB5\fR\fR
.ad
.RS 5n
Inconsistent password files (for example, \fIname\fR is in the
\fB/etc/passwd\fR file and not in the \fB/etc/shadow\fR file, or vice versa).
.RE

.sp
.ne 2
.na
\fB\fB6\fR\fR
.ad
.RS 5n
Unexpected failure. Password files unchanged.
.RE

.sp
.ne 2
.na
\fB\fB7\fR\fR
.ad
.RS 5n
Unexpected failure. Password file(s) missing.
.RE

.sp
.ne 2
.na
\fB\fB8\fR\fR
.ad
.RS 5n
Password file(s) busy. Try again later.
.RE

.sp
.ne 2
.na
\fB\fB9\fR\fR
.ad
.RS 5n
\fIname\fR does not exist (if \fB-m\fR or \fB-d\fR is specified), already
exists (if \fB-a\fR is specified), or \fBlogname\fR already exists (if
\fB\fR\fB-m\fR \fB-l\fR is specified).
.RE

.SH NOTES
.LP
Do not use a colon (\fB:\fR) or \fBRETURN\fR as part of an argument. It is
interpreted as a field separator in the password file. The \fBpassmgmt\fR
command will be removed in a future release. Its functionality has been
replaced and enhanced by \fBuseradd\fR, \fBuserdel\fR, and \fBusermod\fR. These
commands are currently available.
.sp
.LP
This command only modifies password definitions in the local \fB/etc/passwd\fR
and \fB/etc/shadow\fR files. If a network nameservice
is being used to supplement the local files with additional entries,
\fBpassmgmt\fR cannot change information supplied by the network nameservice.