xref: /netbsd-src/usr.sbin/user/usermod.8 (revision 1c9b56c830954ccf3b57004ac65562e3d6afacf6)
1.\" $NetBSD: usermod.8,v 1.20 2005/02/05 15:28:46 wiz Exp $ */
2.\"
3.\"
4.\" Copyright (c) 1999 Alistair G. Crooks.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. All advertising materials mentioning features or use of this software
15.\"    must display the following acknowledgement:
16.\"	This product includes software developed by Alistair G. Crooks.
17.\" 4. The name of the author may not be used to endorse or promote
18.\"    products derived from this software without specific prior written
19.\"    permission.
20.\"
21.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
22.\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
25.\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27.\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29.\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30.\" NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
31.\" SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32.\"
33.\"
34.Dd September 5, 2001
35.Dt USERMOD 8
36.Os
37.Sh NAME
38.Nm usermod
39.Nd modify user login information
40.Sh SYNOPSIS
41.Nm
42.Op Fl Smov
43.Op Fl G Ar secondary-group
44.Op Fl c Ar comment
45.Op Fl d Ar home-dir
46.Op Fl e Ar expiry-time
47.Op Fl f Ar inactive-time
48.Oo
49.Fl g Ar gid | name | Li =uid
50.Oc
51.Op Fl L Ar login-class
52.Op Fl l Ar new-login
53.Op Fl p Ar password
54.Op Fl s Ar shell
55.Op Fl u Ar uid
56.Ar user
57.Sh DESCRIPTION
58The
59.Nm
60utility modifies user login information on the system.
61.Pp
62Default values are taken from the information provided in the
63.Pa /etc/usermgmt.conf
64file, which, if running as root, is created using the built-in defaults if
65it does not exist.
66.Pp
67After setting any defaults, and then reading values from
68.Pa /etc/usermgmt.conf ,
69the following command line options are processed:
70.Bl -tag -width Ds
71.It Fl G Ar secondary-group
72is the secondary group to which the user will be added in the
73.Pa /etc/group
74file.
75.It Fl S
76allows samba user names with a trailing dollar sign to be
77modified.
78.It Fl c Ar comment
79is the comment field (also, for historical reasons known as the
80GECOS field) which will be added for the user, and typically will include
81the user's full name, and, perhaps, contact information for the user.
82.It Fl d Ar home-directory
83Sets the home directory to
84.Ar home-directory
85without populating it; if the
86.Fl m
87option is specified, tries to move the old home directory to
88.Ar home-directory .
89.It Fl e Ar expiry-time
90sets the time at which the current password expires.
91This can be used to implement password aging.
92It should be entered in the form
93.Dq month day year ,
94where month is the month name (the first three characters are
95sufficient), day is the day of the month, and year is the year.
96Time in seconds since the epoch (UTC) is also valid.
97A value of 0 can be used to disable this feature.
98This value can be preset for all users using the
99.Ar expire
100field in the
101.Pa /etc/usermgmt.conf
102file.
103See
104.Xr usermgmt.conf 5
105for more details.
106.It Fl f Ar inactive-time
107sets the time at which the account expires.
108See the
109.Fl e
110option.
111.It Xo
112.Fl g Ar gid | name | Li =uid
113.Xc
114gives the group name or identifier to be used for the user's primary group.
115If this is
116.Ql =uid ,
117then a uid and gid will be picked which are both unique
118and the same, and a line added to
119.Pa /etc/group
120to describe the new group.
121This value can be preset for all users
122by using the
123.Ar gid
124field in the
125.Pa /etc/usermgmt.conf
126file.
127See
128.Xr usermgmt.conf 5
129for more details.
130.It Fl L Ar login-class
131This option sets the login class for the user.
132See
133.Xr login.conf 5
134for more information on user login classes.
135This value can be preset for all users by using the
136.Ar class
137field in the
138.Pa /etc/usermgmt.conf
139file.
140See
141.Xr usermgmt.conf 5
142for more details.
143.It Fl l Ar new-user
144gives the new user name.
145It must consist of alphanumeric characters, or the characters
146.Ql \&. ,
147.Ql \&-
148or
149.Ql \&_ .
150.It Fl m
151moves the home directory from its old position to the new one.
152If
153.Fl d
154is not specified, the
155.Ar new-user
156argument of the
157.Fl l
158option is used; one of
159.Fl d
160and
161.Fl l
162is needed.
163.It Fl o
164allows duplicate uids to be given.
165.It Fl p Ar password
166specifies an already-encrypted password for the user.
167This password can then be changed by using the
168.Xr chpass 1
169utility.
170This value can be preset for all users
171by using the
172.Ar password
173field in the
174.Pa /etc/usermgmt.conf
175file.
176See
177.Xr usermgmt.conf 5
178for more details.
179.It Fl s Ar shell
180specifies the login shell for the user.
181This value can be preset for all users
182by using the
183.Ar shell
184field in the
185.Pa /etc/usermgmt.conf
186file.
187See
188.Xr usermgmt.conf 5
189for more details.
190.It Fl u Ar uid
191specifies a new uid for the user.
192Boundaries for this value can be preset for all users
193by using the
194.Ar range
195field in the
196.Pa /etc/usermgmt.conf
197file.
198See
199.Xr usermgmt.conf 5
200for more details.
201.It Fl v
202enables verbose mode - explain the commands as they are executed.
203.El
204.Pp
205Once the information has been verified,
206.Nm
207uses
208.Xr pwd_mkdb 8
209to update the user database.
210This is run in the background, and,
211at very large sites could take several minutes.
212Until this update
213is completed, the password file is unavailable for other updates
214and the new information is not available to programs.
215.Pp
216The
217.Nm
218utility exits 0 on success, and \*[Gt]0 if an error occurs.
219.Sh FILES
220.Bl -tag -width /etc/usermgmt.conf -compact
221.It Pa /etc/usermgmt.conf
222.El
223.Sh SEE ALSO
224.Xr chpass 1 ,
225.Xr group 5 ,
226.Xr passwd 5 ,
227.Xr usermgmt.conf 5 ,
228.Xr pwd_mkdb 8
229.Sh HISTORY
230The
231.Nm
232utility first appeared in
233.Nx 1.5 .
234It is based on the
235.Ar addnerd
236package by the same author.
237.Sh AUTHORS
238The
239.Nm
240utility was written by
241.An Alistair G. Crooks
242.Aq agc@NetBSD.org .
243