xref: /netbsd-src/usr.sbin/user/usermod.8 (revision 8a5e2a50be13e77dd4df5daf258ddceeeeb47ce6)
1.\" $NetBSD: usermod.8,v 1.22 2005/07/28 20:23:31 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 July 27, 2005
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 moSv
43.Op Fl C Ar yes/no
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.Op Fl G Ar secondary-group
49.Op Fl g Ar gid | name | Li =uid
50.Op Fl L Ar login-class
51.Op Fl l Ar new-login
52.Op Fl p Ar password
53.Op Fl s Ar shell
54.Op Fl u Ar uid
55.Ar user
56.Sh DESCRIPTION
57The
58.Nm
59utility modifies user login information on the system.
60.Pp
61Default values are taken from the information provided in the
62.Pa /etc/usermgmt.conf
63file, which, if running as root, is created using the built-in defaults if
64it does not exist.
65.Pp
66After setting any defaults, and then reading values from
67.Pa /etc/usermgmt.conf ,
68the following command line options are processed:
69.Bl -tag -width Ds
70.It Fl C Ar yes/no
71Enable user accounts to be temporary locked/closed.
72The
73.Ar yes/no
74operand can be given as
75.Dq Ar yes
76to lock the account or
77.Dq Ar no
78to unlock the account.
79.It Fl c Ar comment
80Set the comment field (also, for historical reasons known as the
81GECOS field) for the user.
82The comment field will typically include
83the user's full name and, perhaps, contact information for the user.
84.It Fl d Ar home-directory
85Set the home directory to
86.Ar home-directory
87without populating it; if the
88.Fl m
89option is specified, tries to move the old home directory to
90.Ar home-directory .
91.It Fl e Ar expiry-time
92Set the time at which the current password expires.
93This can be used to implement password aging.
94It should be entered in the form
95.Dq month day year ,
96where month is the month name (the first three characters are
97sufficient), day is the day of the month, and year is the year.
98Time in seconds since the epoch (UTC) is also valid.
99A value of 0 can be used to disable this feature.
100This value can be preset for all users using the
101.Ar expire
102field in the
103.Pa /etc/usermgmt.conf
104file.
105See
106.Xr usermgmt.conf 5
107for more details.
108.It Fl f Ar inactive-time
109Set the time at which the account expires.
110See the
111.Fl e
112option.
113.It Fl G Ar secondary-group
114Specify a secondary group to which the user will be added in the
115.Pa /etc/group
116file.
117.It Fl g Ar gid | name | Li =uid
118Give the group name or identifier to be used for the user's primary group.
119If this is
120.Ql =uid ,
121then a uid and gid will be picked which are both unique
122and the same, and a line will be added to
123.Pa /etc/group
124to describe the new group.
125This value can be preset for all users by using the
126.Ar gid
127field in the
128.Pa /etc/usermgmt.conf
129file.
130See
131.Xr usermgmt.conf 5
132for more details.
133.It Fl L Ar login-class
134Set the login class for the user.
135See
136.Xr login.conf 5
137for more information on user login classes.
138This value can be preset for all users by using the
139.Ar class
140field in the
141.Pa /etc/usermgmt.conf
142file.
143See
144.Xr usermgmt.conf 5
145for more details.
146.It Fl l Ar new-user
147Give the new user name.
148It can consist of alphanumeric characters and the characters
149.Ql \&. ,
150.Ql \&- ,
151and
152.Ql \&_ .
153.It Fl m
154Move the home directory from its old position to the new one.
155If
156.Fl d
157is not specified, the
158.Ar new-user
159argument of the
160.Fl l
161option is used; one of
162.Fl d
163and
164.Fl l
165is needed.
166.It Fl o
167Allow duplicate uids to be given.
168.It Fl p Ar password
169Specify an already-encrypted password for the user.
170This password can then be changed by using the
171.Xr chpass 1
172utility.
173This value can be preset for all users by using the
174.Ar password
175field in the
176.Pa /etc/usermgmt.conf
177file.
178See
179.Xr usermgmt.conf 5
180for more details.
181.It Fl S
182Allow samba user names with a trailing dollar sign to be modified.
183.It Fl s Ar shell
184Specify the login shell for the user.
185This value can be preset for all users by using the
186.Ar shell
187field in the
188.Pa /etc/usermgmt.conf
189file.
190See
191.Xr usermgmt.conf 5
192for more details.
193.It Fl u Ar uid
194Specify a new uid for the user.
195Boundaries for this value can be preset for all users by using the
196.Ar range
197field in the
198.Pa /etc/usermgmt.conf
199file.
200See
201.Xr usermgmt.conf 5
202for more details.
203.It Fl v
204Enable verbose mode - explain the commands as they are executed.
205.El
206.Pp
207Once the information has been verified,
208.Nm
209uses
210.Xr pwd_mkdb 8
211to update the user database.
212This is run in the background.
213At very large sites this can take several minutes.
214Until this update
215is completed, the password file is unavailable for other updates
216and the new information is not available to programs.
217.Sh EXIT STATUS
218.Ex -std usermod
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