1.\" $NetBSD: usermod.8,v 1.4 2000/02/28 05:10:57 enami 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 November 30, 1999 35.Dt USERMOD 8 36.Os NetBSD 37.Sh NAME 38.Nm usermod 39.Nd modify user login information 40.Sh SYNOPSIS 41.Nm 42.Op Fl G Ar secondary-group 43.Op Fl c Ar comment 44.Op Fl d Ar home-dir 45.Op Fl e Ar expiry-time 46.Op Fl f Ar inactive-secs 47.Op Fl g Ar gid/name/=uid 48.Op Fl l Ar new-login 49.Op Fl m 50.Op Fl o 51.Op Fl p Ar password 52.Op Fl s Ar shell 53.Op Fl u Ar uid 54.Op Fl v 55.Ar user 56.Sh DESCRIPTION 57The 58.Nm 59utility modifies user login information on the system. 60Default values for the user are taken from the information 61provided in the 62.Pa /etc/usermgmt.conf 63file. 64.Pp 65After setting any defaults, and then values from that file, 66the command line options are processed: 67.Bl -tag -width Ds 68.It Fl G Ar secondary-group 69is the secondary group to which the user will be added in the 70.Pa /etc/group 71file. 72.It Fl c Ar comment 73is the comment field (also, for historical reasons known as the 74GECOS field) which will be added for the user, and typically will include 75the username, and, perhaps, contact information for the user. 76.It Fl d Ar home-directory 77is the home directory which will be created and populated for the user, 78should the -m option be specified. 79.It Fl e Ar secs-to-expiry 80provides the number of seconds since the epoch (UTC) at 81which the current password change expire. This 82can be used to implement password aging. 83A value of 840 can be used to switch off this feature. 85The default value for this field is 0. 86See 87.Xr passwd 5 88for more details. 89This value can be preset for all users 90by using the 91.Ar expire 92field in the 93.Pa /etc/usermgmt.conf 94file - it has the format: 95.Ar expire <secs-to-expiry> . 96.It Fl g Ar gid/name/=uid 97gives the group name or identifier to be used for the new user's primary group. 98If this is 99.Ar "-g=uid" , 100then a uid and gid will be picked which are both unique 101and the same, and a line added to 102.Pa /etc/group 103to describe the new group. 104This value can be preset for all users 105by using the 106.Ar gid 107field in the 108.Xr /usr/share/adduser/defaults 109file - it has the format: 110.Ar group <groupname/groupid/=uid> . 111.It Fl l Ar new-user 112gives the new user name. 113It must consist of alphanumeric characters, or the characters '.', '-' or '_'. 114.It Fl m 115moves the home directory from its old position to the new one. 116.It Fl o 117allows duplicate uids to be given. 118.It Fl p Ar password 119specifies an already-encrypted password for the new user. 120This password can then be changed by using the 121.Xr chpass 1 122utility. 123This value can be preset for all users 124by using the 125.Ar password 126field in the 127.Pa /etc/usermgmt.conf 128file - it has the format: 129.Ar password <encrypted-password> . 130.It Fl s Ar shell 131specifies the login shell for the new user. 132This value can be preset for all users 133by using the 134.Ar shell 135field in the 136.Xr /usr/share/adduser/defaults 137file - it has the format: 138.Ar shell <login-shell> . 139.It Fl u Ar uid 140specifies a new uid for the user. 141Boundaries for this value can be preset for all users 142by using the 143.Ar range 144field in the 145.Pa /etc/usermgmt.conf 146file - they have the format: 147.Ar range <starting-uid>..<ending_uid> . 148.It Fl v 149enables verbose mode - explain the commands as they are executed. 150.El 151.Pp 152The 153.Nm 154utility exits 0 on success, and >0 if an error occurs. 155.Sh FILES 156.Bl -tag -width /etc/usermgmt.conf -compact 157.It Pa /etc/usermgmt.conf 158.It Pa /etc/skel/.[A-z]* 159.It Pa /usr/share/examples/usermgmt 160.El 161.Sh SEE ALSO 162.Xr chpass 1 , 163.Xr passwd 5 , 164.Xr group 5 165.Sh HISTORY 166The 167.Nm 168utility first appeared in 169.Nx 1.5 . 170It is based on the 171.Ar addnerd 172package by the same author. 173.Sh AUTHOR 174The 175.Nm 176utility was written by Alistair G. Crooks (agc@netbsd.org). 177