add usermgmt.conf man page.

user -e and -f now accepts "month day year" (ala chpass(1)) and
seconds-since-epoch.
correct man pages accordingly.
This commit is contained in:
grant 2002-06-01 06:28:06 +00:00
parent 23d9c4fc27
commit 9210200e15
8 changed files with 300 additions and 160 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.8 2001/10/22 11:00:05 agc Exp $
# $NetBSD: Makefile,v 1.9 2002/06/01 06:28:06 grant Exp $
#
.include <bsd.own.mk>
@ -18,7 +18,7 @@ LINKS+= ${BINDIR}/user ${BINDIR}/userinfo
LINKS+= ${BINDIR}/user ${BINDIR}/groupinfo
LDADD+= -lutil
DPADD+= ${LIBUTIL}
MAN= user.8 useradd.8 userdel.8 usermod.8 userinfo.8
MAN= user.8 useradd.8 userdel.8 usermod.8 userinfo.8 usermgmt.conf.5
MAN+= group.8 groupadd.8 groupdel.8 groupmod.8 groupinfo.8
MLINKS= useradd.8 adduser.8

View File

@ -1,4 +1,4 @@
.\" $NetBSD: user.8,v 1.12 2002/02/08 01:38:57 ross Exp $ */
.\" $NetBSD: user.8,v 1.13 2002/06/01 06:28:06 grant Exp $ */
.\"
.\"
.\" Copyright (c) 1999 Alistair G. Crooks. All rights reserved.
@ -43,7 +43,7 @@
.Fl D
.Op Fl b Ar base-dir
.Op Fl e Ar expiry-time
.Op Fl f Ar inactive-secs
.Op Fl f Ar inactive-time
.Op Fl g Ar gid/name/=uid
.Op Fl L Ar login-class
.Op Fl r Ar low..high
@ -55,7 +55,7 @@
.Op Fl c Ar comment
.Op Fl d Ar home-dir
.Op Fl e Ar expiry-time
.Op Fl f Ar inactive-secs
.Op Fl f Ar inactive-time
.Op Fl g Ar gid/name/=uid
.Op Fl k Ar skel-dir
.Op Fl L Ar login-class
@ -83,7 +83,7 @@
.Op Fl c Ar comment
.Op Fl d Ar home-dir
.Op Fl e Ar expiry-time
.Op Fl f Ar inactive-secs
.Op Fl f Ar inactive-time
.Op Fl g Ar gid/name/=uid
.Op Fl L Ar login-class
.Op Fl l Ar new-login
@ -126,6 +126,7 @@ and
.Xr chpass 1 ,
.Xr group 5 ,
.Xr passwd 5 ,
.Xr usermgmt.conf 5 ,
.Xr useradd 8 ,
.Xr userdel 8 ,
.Xr userinfo 8 ,

View File

@ -1,4 +1,4 @@
/* $NetBSD: user.c,v 1.51 2002/05/03 10:31:14 agc Exp $ */
/* $NetBSD: user.c,v 1.52 2002/06/01 06:28:06 grant Exp $ */
/*
* Copyright (c) 1999 Alistair G. Crooks. All rights reserved.
@ -35,7 +35,7 @@
#ifndef lint
__COPYRIGHT("@(#) Copyright (c) 1999 \
The NetBSD Foundation, Inc. All rights reserved.");
__RCSID("$NetBSD: user.c,v 1.51 2002/05/03 10:31:14 agc Exp $");
__RCSID("$NetBSD: user.c,v 1.52 2002/06/01 06:28:06 grant Exp $");
#endif
#include <sys/types.h>
@ -80,7 +80,7 @@ typedef struct user_t {
char *u_shell; /* user's shell */
char *u_basedir; /* base directory for home */
char *u_expire; /* when password will expire */
int u_inactive; /* inactive */
char *u_inactive; /* when account will expire */
char *u_skeldir; /* directory for startup files */
char *u_class; /* login class */
unsigned u_rsize; /* size of range array */
@ -180,6 +180,7 @@ enum {
#define PAX "/bin/pax"
#define RM "/bin/rm"
#define UNSET_INACTIVE "Null (unset)"
#define UNSET_EXPIRY "Null (unset)"
static int asystem(const char *fmt, ...)
@ -416,7 +417,7 @@ creategid(char *group, int gid, char *name)
return 0;
}
if ((from = fopen(_PATH_GROUP, "r")) == NULL) {
warn("can't create gid for %s: can't open %s", name, _PATH_GROUP);
warn("can't create gid for `%s': can't open `%s'", name, _PATH_GROUP);
return 0;
}
if (flock(fileno(from), LOCK_EX | LOCK_NB) < 0) {
@ -473,7 +474,7 @@ modify_gid(char *group, char *newent)
int cc;
if ((from = fopen(_PATH_GROUP, "r")) == NULL) {
warn("can't create gid for %s: can't open %s", group, _PATH_GROUP);
warn("can't create gid for `%s': can't open `%s'", group, _PATH_GROUP);
return 0;
}
if (flock(fileno(from), LOCK_EX | LOCK_NB) < 0) {
@ -560,7 +561,7 @@ append_group(char *user, int ngroups, char **groups)
}
}
if ((from = fopen(_PATH_GROUP, "r")) == NULL) {
warn("can't append group for %s: can't open %s", user, _PATH_GROUP);
warn("can't append group for `%s': can't open `%s'", user, _PATH_GROUP);
return 0;
}
if (flock(fileno(from), LOCK_EX | LOCK_NB) < 0) {
@ -725,7 +726,7 @@ setdefaults(user_t *up)
#ifdef EXTENSIONS
fprintf(fp, "class\t\t%s\n", up->u_class) <= 0 ||
#endif
fprintf(fp, "inactive\t%d\n", up->u_inactive) <= 0 ||
fprintf(fp, "inactive\t%s\n", (up->u_inactive == NULL) ? UNSET_INACTIVE : up->u_inactive) <= 0 ||
fprintf(fp, "expire\t\t%s\n", (up->u_expire == NULL) ? UNSET_EXPIRY : up->u_expire) <= 0 ||
fprintf(fp, "preserve\t%s\n", (up->u_preserve == 0) ? "false" : "true") <= 0) {
warn("can't write to `%s'", CONFFILE);
@ -803,7 +804,14 @@ read_defaults(user_t *up)
} else if (strncmp(s, "inactive", 8) == 0) {
for (cp = s + 8 ; *cp && isspace(*cp) ; cp++) {
}
up->u_inactive = atoi(cp);
if (strcmp(cp, UNSET_INACTIVE) == 0) {
if (up->u_inactive) {
FREE(up->u_inactive);
}
up->u_inactive = NULL;
} else {
memsave(&up->u_inactive, cp, strlen(cp));
}
#ifdef EXTENSIONS
} else if (strncmp(s, "range", 5) == 0) {
for (cp = s + 5 ; *cp && isspace(*cp) ; cp++) {
@ -868,6 +876,7 @@ adduser(char *login, user_t *up)
struct stat st;
struct tm tm;
time_t expire;
time_t inactive;
char password[PasswordLength + 1];
char home[MaxFileNameLen];
char buf[MaxFileNameLen];
@ -964,13 +973,32 @@ adduser(char *login, user_t *up)
/* if home directory hasn't been given, make it up */
(void) snprintf(home, sizeof(home), "%s/%s", up->u_basedir, login);
}
inactive = 0;
if (up->u_inactive != NULL) {
(void) memset(&tm, 0, sizeof(tm));
if (strptime(up->u_inactive, "%c", &tm) != NULL) {
inactive = mktime(&tm);
} else if (strptime(up->u_inactive, "%B %d %Y", &tm) != NULL) {
inactive = mktime(&tm);
} else if (isdigit(up->u_inactive[0]) != NULL) {
inactive = atoi(up->u_inactive);
} else {
warnx("Warning: inactive time `%s' invalid, account expiry off",
up->u_inactive);
}
}
expire = 0;
if (up->u_expire != NULL) {
(void) memset(&tm, 0, sizeof(tm));
if (strptime(up->u_expire, "%c", &tm) == NULL) {
warnx("invalid time format `%s'", optarg);
} else {
if (strptime(up->u_expire, "%c", &tm) != NULL) {
expire = mktime(&tm);
} else if (strptime(up->u_expire, "%B %d %Y", &tm) != NULL) {
expire = mktime(&tm);
} else if (isdigit(up->u_expire[0]) != NULL) {
expire = atoi(up->u_expire);
} else {
warnx("Warning: expire time `%s' invalid, password expiry off",
up->u_expire);
}
}
if (lstat(home, &st) < 0 && !(up->u_flags & F_MKDIR)) {
@ -988,7 +1016,7 @@ adduser(char *login, user_t *up)
up->u_password, password);
}
}
cc = snprintf(buf, sizeof(buf), "%s:%s:%d:%d:%s:%d:%ld:%s:%s:%s\n",
cc = snprintf(buf, sizeof(buf), "%s:%s:%d:%d:%s:%ld:%ld:%s:%s:%s\n",
login,
password,
up->u_uid,
@ -998,7 +1026,7 @@ adduser(char *login, user_t *up)
#else
"",
#endif
up->u_inactive,
(long) inactive,
(long) expire,
up->u_comment,
home,
@ -1142,14 +1170,31 @@ moduser(char *login, char *newlogin, user_t *up)
errx(EXIT_FAILURE, "group %s not found", up->u_primgrp);
}
}
if (up->u_flags |= F_INACTIVE)
pwp->pw_change = up->u_inactive;
if (up->u_flags & F_INACTIVE) {
(void) memset(&tm, 0, sizeof(tm));
if (strptime(up->u_inactive, "%c", &tm) != NULL) {
pwp->pw_change = mktime(&tm);
} else if (strptime(up->u_inactive, "%B %d %Y", &tm) != NULL) {
pwp->pw_change = mktime(&tm);
} else if (isdigit(up->u_inactive[0]) != NULL) {
pwp->pw_change = atoi(up->u_inactive);
} else {
warnx("Warning: inactive time `%s' invalid, password expiry off",
up->u_inactive);
}
}
if (up->u_flags & F_EXPIRE) {
(void) memset(&tm, 0, sizeof(tm));
if (strptime(up->u_expire, "%c", &tm) == NULL)
warnx("invalid time format `%s'", optarg);
else
if (strptime(up->u_expire, "%c", &tm) != NULL) {
pwp->pw_expire = mktime(&tm);
} else if (strptime(up->u_expire, "%B %d %Y", &tm) != NULL) {
pwp->pw_expire = mktime(&tm);
} else if (isdigit(up->u_expire[0]) != NULL) {
pwp->pw_expire = atoi(up->u_expire);
} else {
warnx("Warning: expire time `%s' invalid, password expiry off",
up->u_expire);
}
}
if (up->u_flags & F_COMMENT)
pwp->pw_gecos = up->u_comment;
@ -1372,7 +1417,7 @@ useradd(int argc, char **argv)
break;
case 'f':
defaultfield = 1;
u.u_inactive = atoi(optarg);
memsave(&u.u_inactive, optarg, strlen(optarg));
break;
case 'g':
defaultfield = 1;
@ -1434,7 +1479,7 @@ useradd(int argc, char **argv)
#ifdef EXTENSIONS
(void) printf("class\t\t%s\n", u.u_class);
#endif
(void) printf("inactive\t%d\n", u.u_inactive);
(void) printf("inactive\t%s\n", (u.u_inactive == NULL) ? UNSET_INACTIVE : u.u_inactive);
(void) printf("expire\t\t%s\n", (u.u_expire == NULL) ? UNSET_EXPIRY : u.u_expire);
#ifdef EXTENSIONS
for (i = 0 ; i < u.u_rc ; i++) {
@ -1496,7 +1541,7 @@ usermod(int argc, char **argv)
u.u_flags |= F_EXPIRE;
break;
case 'f':
u.u_inactive = atoi(optarg);
memsave(&u.u_inactive, optarg, strlen(optarg));
u.u_flags |= F_INACTIVE;
break;
case 'g':

View File

@ -1,4 +1,4 @@
.\" $NetBSD: useradd.8,v 1.16 2002/05/28 04:39:08 grant Exp $ */
.\" $NetBSD: useradd.8,v 1.17 2002/06/01 06:28:06 grant Exp $ */
.\"
.\"
.\" Copyright (c) 1999 Alistair G. Crooks. All rights reserved.
@ -42,7 +42,7 @@
.Fl D
.Op Fl b Ar base-dir
.Op Fl e Ar expiry-time
.Op Fl f Ar inactive-secs
.Op Fl f Ar inactive-time
.Oo
.Fl g Ar gid | name | Li =uid Oc
.Op Fl L Ar login-class
@ -58,7 +58,7 @@
.Op Fl c Ar comment
.Op Fl d Ar home-dir
.Op Fl e Ar expiry-time
.Op Fl f Ar inactive-secs
.Op Fl f Ar inactive-time
.Oo
.Fl g Ar gid | name | Li =uid Oc
.Op Fl k Ar skel-dir
@ -107,29 +107,38 @@ will be used by the
utility. Together with one of the options shown for the first version
of the command,
.Fl D
will set the default to be the new value.
will set the default to be the new value. See
.Xr usermgmt.conf 5
for more information.
.It Fl b Ar base-dir
sets the base directory. This is the directory to which the user directory
is added, which will be created if the
sets the default base directory. This is the directory to which the
user directory is added, which will be created if the
.Fl m
option is specified and no
.Fl d
option is specified.
.It Fl e Ar expiry-time
sets the time at which the current password will expire for new users.
.It Fl f Ar inactive-secs
sets the number of seconds after which, if no login has occurred for
the user during that time, the login will be
.Dq locked .
sets the default time at which the current password will expire for new
users.
It should be entered in the form
.Dq month day year ,
where month is the month name (the first three characters are
sufficient), day is the day of the month, and year is the year. Time
in seconds since the epoch (UTC) is also valid.
A value of 0 can be used to disable this feature.
.It Fl f Ar inactive-time
sets the default time at which new user accounts will expire.
Also see the
.Fl e
option above.
.It Fl g Ar gid | groupname | Li =uid
sets the default group for any user added using the
.Nm
command.
sets the default group for new users.
.It Fl k Ar skel-dir
sets the skeleton directory in which to find files with
which to populate new users' home directories.
.It Fl L Ar login-class
This option sets the login class for the user being created. See
sets the default login class for new users.
See
.Xr login.conf 5
for more information on user login classes.
.It Xo
@ -139,7 +148,7 @@ sets the low and high bounds of uid ranges for new users. A new user
can only be created if there are uids which can be assigned from one
of the free ranges.
.It Fl s Ar shell
sets the login shell for new users.
sets the default login shell for new users.
.El
.Pp
In the second form of the command,
@ -153,13 +162,6 @@ file.
.It Fl b Ar base-directory
is the base directory name, in which the user's new home
directory will be created, should the -m option be specified.
This value can be preset for all users
by using the
.Ar base_dir
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.D1 Ic base_dir Ar path-to-base-dir
.It Fl c Ar comment
is the comment field (also, for historical reasons known as the
GECOS field) which will be added for the user, and typically will include
@ -167,23 +169,18 @@ the username, and, perhaps, contact information for the user.
.It Fl d Ar home-directory
is the home directory which will be created and populated for the user,
should the -m option be specified.
.It Fl e Ar secs-to-expiry
provides the number of seconds since the epoch (UTC) at
which the current password change expire. This
can be used to implement password aging.
A value of
0 can be used to switch off this feature.
The default value for this field is 0.
.It Fl e Ar expiry-time
sets the default time at which the current password will expire for new
users.
It should be entered in the form
.Dq month day year ,
where month is the month name (the first three characters are
sufficient), day is the day of the month, and year is the year. Time
in seconds since the epoch (UTC) is also valid.
A value of 0 can be used to disable this feature.
See
.Xr passwd 5
for more details.
This value can be preset for all users
by using the
.Ar expire
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.D1 Ic expire Ar secs-to-expiry
.It Fl g Ar gid | name | Li =uid
gives the group name or identifier to be used for the new user's primary group.
If this is
@ -192,44 +189,13 @@ then a uid and gid will be picked which are both unique
and the same, and a line added to
.Pa /etc/group
to describe the new group.
This value can be preset for all users
by using the
.Ar gid
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.br \" XXX This shouldn't be needed -- mdoc bug? --bjh21
.Bd -ragged -offset indent -compact
.Ic group
.Ar gid | name | Li =uid
.Ed
.It Fl k Ar skeleton directory
gives the skeleton directory in which to find files
with which to populate the new user's home directory.
This value can be preset for all users by using the
.Ar skel_dir
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.br \" XXX skip empty line? - HF
.Bd -ragged -offset indent -compact
.Ic skel_dir
.Ar path-to-skeleton-dir
.Ed
.It Fl L Ar login-class
This option sets the login class for the user being created. See
.Xr login.conf 5
for more information on user login classes. The value can be preset
for all users by using the
.Ar class
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.br \" XXX skip empty line? - HF
.Bd -ragged -offset indent -compact
.Ic class
.Ar login-class
.Ed
for more information on user login classes.
.It Fl m
create a new home directory for the new user.
.It Fl o
@ -239,22 +205,8 @@ specifies an already-encrypted password for the new user.
This password can then be changed by using the
.Xr chpass 1
utility.
This value can be preset for all users
by using the
.Ar password
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.D1 Ic password Ar encrypted-password
.It Fl s Ar shell
specifies the login shell for the new user.
This value can be preset for all users
by using the
.Ar shell
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.D1 Ic shell Ar login-shell
.It Fl u Ar uid
specifies a uid for the new user.
Boundaries for this value can be preset for all users
@ -262,10 +214,7 @@ by using the
.Ar range
field in the
.Pa /etc/usermgmt.conf
file - they have the format:
.Bd -unfilled -offset indent -compact
.Ic range Ar starting-uid Ns Li .. Ns Ar ending-uid
.Ed
file.
.It Fl v
enables verbose mode - explain the commands as they are executed.
.El
@ -292,6 +241,7 @@ utility exits 0 on success, and \*[Gt]0 if an error occurs.
.Xr chpass 1 ,
.Xr group 5 ,
.Xr login.conf 5 ,
.Xr usermgmt.conf 5 ,
.Xr passwd 5 ,
.Xr pwd_mkdb 8 ,
.Xr user 8 ,

View File

@ -1,4 +1,4 @@
.\" $NetBSD: userdel.8,v 1.14 2002/02/08 01:38:57 ross Exp $ */
.\" $NetBSD: userdel.8,v 1.15 2002/06/01 06:28:06 grant Exp $ */
.\"
.\"
.\" Copyright (c) 1999 Alistair G. Crooks. All rights reserved.
@ -117,6 +117,7 @@ utility exits 0 on success, and \*[Gt]0 if an error occurs.
.El
.Sh SEE ALSO
.Xr passwd 5 ,
.Xr usermgmt.conf 5 ,
.Xr nologin 8 ,
.Xr pwd_mkdb 8
.Sh HISTORY

View File

@ -1,4 +1,4 @@
.\" $NetBSD: userinfo.8,v 1.6 2002/02/02 02:06:50 wiz Exp $ */
.\" $NetBSD: userinfo.8,v 1.7 2002/06/01 06:28:06 grant Exp $ */
.\"
.\"
.\" Copyright (c) 1999 Alistair G. Crooks. All rights reserved.
@ -70,7 +70,8 @@ utility exits 0 if the user name or uid exists, and non-zero if it does not.
.It Pa /etc/usermgmt.conf
.El
.Sh SEE ALSO
.Xr passwd 5
.Xr passwd 5 ,
.Xr usermgmt.conf 5
.Sh HISTORY
The
.Nm

View File

@ -0,0 +1,139 @@
.\" $NetBSD: usermgmt.conf.5,v 1.1 2002/06/01 06:28:06 grant Exp $
.\"
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
.\" All rights reserved.
.\"
.\" This document is derived from works contributed to The NetBSD Foundation
.\" by Grant Beattie.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
.\" BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
.\" AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd May 28, 2002
.Dt USERMGMT.CONF 5
.Os
.\" turn off hyphenation
.hym 999
.Sh NAME
.Nm usermgmt.conf
.Nd user management tools configuration file
.Sh SYNOPSIS
.Nm usermgmt.conf
.Sh DESCRIPTION
The
.Nm usermgmt.conf
file defines the default values used by the user management tools,
.Xr useradd 8
and friends.
.Pp
Options in this file can be set by manually editing
.Pa /etc/usermgmt.conf
or using the
.Fl D
option to
.Xr useradd 8 .
.Pp
.Bl -tag -width Ds
.It Ic base_dir
sets the base directory name, in which new users' home directories
are created when using the
.Fl m
option to
.Xr useradd 8 .
.It Ic class
sets the default login class for new users.
See
.Xr login.conf 5
for more information on user login classes.
.It Ic expire
sets the default time at which the current password expires. This
can be used to implement password aging. Both the
.Ar expire
and
.Ar inactive
fields should be entered in the form
.Dq month day year ,
where month is the month name (the first three characters are
sufficient), day is the day of the month, and year is the year. Time
in seconds since the epoch (UTC) is also valid.
A value of 0 can be used to disable this feature.
.It Ic group
sets the default primary group for new users.
If this is
.Ql =uid ,
then a uid and gid will be picked which are both unique
and the same, and a line added to
.Pa /etc/group
to describe the new group. It has the format:
.br
.Bd -ragged -offset indent -compact
.Ic group
.Ar gid | name | Li =uid
.Ed
.It Ic inactive
sets the default time at which new accounts expire.
A value of 0 can be used to disable this feature.
Also see the
.Ar expire
field.
.It Ic password
specifies an already-encrypted default password.
.It Ic preserve
If this value is one of
.Ql true ,
.Ql yes ,
or a non-zero number, then the user login information will be
preserved when removing a user with
.Xr userdel 8 .
.It Ic range
specifies the uid boundaries for new users.
If unspecified, the default is
.Dq 1000..60000 .
It has the format:
.Bd -unfilled -offset indent -compact
.Ic range Ar starting-uid Ns Li .. Ns Ar ending-uid
.Ed
.It Ic shell
sets the default login shell for new users.
.It Ic skel_dir
sets the default skeleton directory in which to find files
with which to populate the new user's home directory.
.El
.Sh FILES
.Bl -tag -width /etc/usermgmt.conf -compact
.It Pa /etc/usermgmt.conf
.It Pa /etc/skel/*
.It Pa /etc/login.conf
.El
.Sh SEE ALSO
.Xr login.conf 5 ,
.Xr passwd 5 ,
.Xr user 8 ,
.Xr useradd 8 ,
.Xr userdel 8 ,
.Xr usermod 8
.Sh HISTORY
The
.Nm
configuration file first appeared in
.Nx 1.5 .

View File

@ -1,4 +1,4 @@
.\" $NetBSD: usermod.8,v 1.14 2002/02/08 01:38:57 ross Exp $ */
.\" $NetBSD: usermod.8,v 1.15 2002/06/01 06:28:06 grant Exp $ */
.\"
.\"
.\" Copyright (c) 1999 Alistair G. Crooks. All rights reserved.
@ -44,7 +44,7 @@
.Op Fl c Ar comment
.Op Fl d Ar home-dir
.Op Fl e Ar expiry-time
.Op Fl f Ar inactive-secs
.Op Fl f Ar inactive-time
.Oo
.Fl g Ar gid | name | Li =uid
.Oc
@ -81,27 +81,31 @@ without populating it; if the
.Fl m
option is specified, tries to move the old home directory to
.Ar home-directory .
.It Fl e Ar secs-to-expiry
provides the number of seconds since the epoch (UTC) at
which the current password change expire. This
can be used to implement password aging.
A value of
0 can be used to switch off this feature.
The default value for this field is 0.
See
.Xr passwd 5
for more details.
This value can be preset for all users
by using the
.It Fl e Ar expiry-time
sets the time at which the current password expires. This can be used
to implement password aging. It should be entered in the form
.Dq month day year ,
where month is the month name (the first three characters are
sufficient), day is the day of the month, and year is the year.
Time in seconds since the epoch (UTC) is also valid. A value of
0 can be used to disable this feature.
This value can be preset for all users using the
.Ar expire
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.D1 Ic expire Ar secs-to-expiry
file.
See
.Xr usermgmt.conf 5
for more details.
.It Fl f Ar inactive-time
sets the time at which the account expires.
See the
.Fl e
option.
.It Xo
.Fl g Ar gid | name | Li =uid
.Xc
gives the group name or identifier to be used for the new user's primary group.
gives the group name or identifier to be used for the user's primary group.
If this is
.Ql =uid ,
then a uid and gid will be picked which are both unique
@ -113,26 +117,22 @@ by using the
.Ar gid
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.br \" XXX Shouldn't be necessary -- mdoc bug? --bjh21
.Bd -ragged -offset indent -compact
.Ic group
.Ar gid | name | Li =uid
.Ed
file.
See
.Xr usermgmt.conf 5
for more details.
.It Fl L Ar login-class
This option sets the login class for the user being created. See
This option sets the login class for the user. See
.Xr login.conf 5
for more information on user login classes. Thie value can be preset
for more information on user login classes. This value can be preset
for all users by using the
.Ar class
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.br \" XXX skip empty line? - HF
.Bd -ragged -offset indent -compact
.Ic class
.Ar login-class
.Ed
file.
See
.Xr usermgmt.conf 5
for more details.
.It Fl l Ar new-user
gives the new user name.
It must consist of alphanumeric characters, or the characters
@ -156,7 +156,7 @@ is needed.
.It Fl o
allows duplicate uids to be given.
.It Fl p Ar password
specifies an already-encrypted password for the new user.
specifies an already-encrypted password for the user.
This password can then be changed by using the
.Xr chpass 1
utility.
@ -165,17 +165,21 @@ by using the
.Ar password
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.D1 Ic password Ar encrypted-password
file.
See
.Xr usermgmt.conf 5
for more details.
.It Fl s Ar shell
specifies the login shell for the new user.
specifies the login shell for the user.
This value can be preset for all users
by using the
.Ar shell
field in the
.Pa /etc/usermgmt.conf
file - it has the format:
.D1 Ic shell Ar login-shell
file.
See
.Xr usermgmt.conf 5
for more details.
.It Fl u Ar uid
specifies a new uid for the user.
Boundaries for this value can be preset for all users
@ -183,12 +187,10 @@ by using the
.Ar range
field in the
.Pa /etc/usermgmt.conf
file - they have the format:
.br \" XXX
.Bd -ragged -offset indent -compact
.Ic range
.Ar starting-uid Ns Li .. Ns Ar ending_uid
.Ed
file.
See
.Xr usermgmt.conf 5
for more details.
.It Fl v
enables verbose mode - explain the commands as they are executed.
.El
@ -213,6 +215,7 @@ utility exits 0 on success, and \*[Gt]0 if an error occurs.
.Xr chpass 1 ,
.Xr group 5 ,
.Xr passwd 5 ,
.Xr usermgmt.conf 5 ,
.Xr pwd_mkdb 8
.Sh HISTORY
The