1.\" $NetBSD: usermod.8,v 1.15 2002/06/01 06:28:06 grant 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 mov 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. 61Default values for the user are taken from the information 62provided in the 63.Pa /etc/usermgmt.conf 64file. 65.Pp 66After setting any defaults, and then values from that file, 67the command line options are processed: 68.Bl -tag -width Ds 69.It Fl G Ar secondary-group 70is the secondary group to which the user will be added in the 71.Pa /etc/group 72file. 73.It Fl c Ar comment 74is the comment field (also, for historical reasons known as the 75GECOS field) which will be added for the user, and typically will include 76the username, and, perhaps, contact information for the user. 77.It Fl d Ar home-directory 78Sets the home directory to 79.Ar home-directory 80without populating it; if the 81.Fl m 82option is specified, tries to move the old home directory to 83.Ar home-directory . 84.It Fl e Ar expiry-time 85sets the time at which the current password expires. This can be used 86to implement password aging. It should be entered in the form 87.Dq month day year , 88where month is the month name (the first three characters are 89sufficient), day is the day of the month, and year is the year. 90Time in seconds since the epoch (UTC) is also valid. A value of 910 can be used to disable this feature. 92This value can be preset for all users using the 93.Ar expire 94field in the 95.Pa /etc/usermgmt.conf 96file. 97See 98.Xr usermgmt.conf 5 99for more details. 100.It Fl f Ar inactive-time 101sets the time at which the account expires. 102See the 103.Fl e 104option. 105.It Xo 106.Fl g Ar gid | name | Li =uid 107.Xc 108gives the group name or identifier to be used for the user's primary group. 109If this is 110.Ql =uid , 111then a uid and gid will be picked which are both unique 112and the same, and a line added to 113.Pa /etc/group 114to describe the new group. 115This value can be preset for all users 116by using the 117.Ar gid 118field in the 119.Pa /etc/usermgmt.conf 120file. 121See 122.Xr usermgmt.conf 5 123for more details. 124.It Fl L Ar login-class 125This option sets the login class for the user. See 126.Xr login.conf 5 127for more information on user login classes. This value can be preset 128for all users by using the 129.Ar class 130field in the 131.Pa /etc/usermgmt.conf 132file. 133See 134.Xr usermgmt.conf 5 135for more details. 136.It Fl l Ar new-user 137gives the new user name. 138It must consist of alphanumeric characters, or the characters 139.Ql \&. , 140.Ql \&- 141or 142.Ql \&_ . 143.It Fl m 144moves the home directory from its old position to the new one. 145If 146.Fl d 147is not specified, the 148.Ar new-user 149argument of the 150.Fl l 151option is used; one of 152.Fl d 153and 154.Fl l 155is needed. 156.It Fl o 157allows duplicate uids to be given. 158.It Fl p Ar password 159specifies an already-encrypted password for the user. 160This password can then be changed by using the 161.Xr chpass 1 162utility. 163This value can be preset for all users 164by using the 165.Ar password 166field in the 167.Pa /etc/usermgmt.conf 168file. 169See 170.Xr usermgmt.conf 5 171for more details. 172.It Fl s Ar shell 173specifies the login shell for the user. 174This value can be preset for all users 175by using the 176.Ar shell 177field in the 178.Pa /etc/usermgmt.conf 179file. 180See 181.Xr usermgmt.conf 5 182for more details. 183.It Fl u Ar uid 184specifies a new uid for the user. 185Boundaries for this value can be preset for all users 186by using the 187.Ar range 188field in the 189.Pa /etc/usermgmt.conf 190file. 191See 192.Xr usermgmt.conf 5 193for more details. 194.It Fl v 195enables verbose mode - explain the commands as they are executed. 196.El 197.Pp 198Once the information has been verified, 199.Nm 200uses 201.Xr pwd_mkdb 8 202to update the user database. This is run in the background, and, 203at very large sites could take several minutes. Until this update 204is completed, the password file is unavailable for other updates 205and the new information is not available to programs. 206.Pp 207The 208.Nm 209utility exits 0 on success, and \*[Gt]0 if an error occurs. 210.Sh FILES 211.Bl -tag -width /etc/usermgmt.conf -compact 212.It Pa /etc/usermgmt.conf 213.El 214.Sh SEE ALSO 215.Xr chpass 1 , 216.Xr group 5 , 217.Xr passwd 5 , 218.Xr usermgmt.conf 5 , 219.Xr pwd_mkdb 8 220.Sh HISTORY 221The 222.Nm 223utility first appeared in 224.Nx 1.5 . 225It is based on the 226.Ar addnerd 227package by the same author. 228.Sh AUTHORS 229The 230.Nm 231utility was written by Alistair G. Crooks (agc@netbsd.org). 232