OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / shadow / original / man8 / useradd.8
1 .\"$Id: useradd.8,v 1.13 2002/03/08 04:39:12 kloczek Exp $
2 .\" Copyright 1991 - 1994, Julianne Frances Haugh
3 .\" All rights reserved.
4 .\"
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
7 .\" are met:
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\"    notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\"    notice, this list of conditions and the following disclaimer in the
12 .\"    documentation and/or other materials provided with the distribution.
13 .\" 3. Neither the name of Julianne F. Haugh nor the names of its contributors
14 .\"    may be used to endorse or promote products derived from this software
15 .\"    without specific prior written permission.
16 .\"
17 .\" THIS SOFTWARE IS PROVIDED BY JULIE HAUGH AND CONTRIBUTORS ``AS IS'' AND
18 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 .\" ARE DISCLAIMED.  IN NO EVENT SHALL JULIE HAUGH OR CONTRIBUTORS BE LIABLE
21 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 .\" SUCH DAMAGE.
28 .TH USERADD 8
29 .SH NAME
30 useradd \- Create a new user or update default new user information
31 .SH SYNOPSIS
32 .TP 8
33 \fBuseradd\fR [\fB-c\fR \fIcomment\fR] [\fB-d\fR \fIhome_dir\fR]
34 .br
35 [\fB-e\fR \fIexpire_date\fR] [\fB-f\fR \fIinactive_time\fR]
36 .br
37 [\fB-g\fR \fIinitial_group\fR] [\fB-G\fR \fIgroup\fR[,...]]
38 .br
39 [\fB-m\fR [\fB-k\fR \fIskeleton_dir\fR]] [\fB-o\fR] [\fB-p\fR \fIpasswd\fR]
40 .br
41 [\fB-s\fR \fIshell\fR] [\fB-u\fR \fIuid\fR] \fIlogin\fR
42 .TP 8
43 \fBuseradd\fR \fB-D\fR [\fB-g\fI default_group\fR] [\fB-b\fI default_home\fR]
44 .br
45 [\fB-e\fI default_expire_date\fR] [\fB-f\fI default_inactive\fR]
46 .br
47 [\fB-s\fI default_shell\fR]
48 .SH DESCRIPTION
49 .SS Creating New Users
50 When invoked without the \fB-D\fR option, the \fBuseradd\fR command
51 creates a new user account using the values specified on the
52 command line and the default values from the system.
53 The new user account will be entered into the system files as needed,
54 the home directory will be created, and initial files copied, depending
55 on the command line options.
56 The options which apply to the \fBuseradd\fR command are:
57 .IP "\fB-c \fIcomment\fR"
58 The new user's password file comment field.
59 .IP "\fB-d \fIhome_dir\fR"
60 The new user will be created using \fIhome_dir\fR as the value for
61 the user's login directory.
62 The default is to append the \fIlogin\fR name to \fIdefault_home\fR
63 and use that as the login directory name.
64 .IP "\fB-e \fIexpire_date\fR"
65 The date on which the user account will be disabled.
66 The date is specified in the format \fIYYYY-MM-DD\fR.
67 .IP "\fB-f \fIinactive_days\fR"
68 The number of days after a password expires until the account
69 is permanently disabled.
70 A value of 0 disables the account as soon as the password has
71 expired, and a value of -1 disables the feature.
72 The default value is -1.
73 .IP "\fB-g \fIinitial_group\fR"
74 The group name or number of the user's initial login group.
75 The group name must exist.  A group number must refer to an
76 already existing group.
77 The default group number is 1 or whatever is specified in
78 \fI/etc/default/useradd\fR.
79 .IP "\fB-G \fIgroup,[...]\fR"
80 A list of supplementary groups which the user is also a member
81 of.
82 Each group is separated from the next by a comma, with no
83 intervening whitespace.
84 The groups are subject to the same restrictions as the group
85 given with the \fB-g\fR option.
86 The default is for the user to belong only to the initial group.
87 .IP \fB-m\fR
88 The user's home directory will be created if it does not exist.
89 The files contained in \fIskeleton_dir\fR will be copied to the
90 home directory if the \fB-k\fR option is used, otherwise the
91 files contained in \fI/etc/skel\fR will be used instead.
92 Any directories contained in \fIskeleton_dir\fR or \fI/etc/skel\fR
93 will be created in the user's home directory as well.
94 The \fB-k\fR option is only valid in conjunction with the \fB-m\fR
95 option.
96 The default is to not create the directory and to not copy any
97 files.
98 .IP "\fB-o\fR"
99 Allow create user with duplicate (non-unique) UID.
100 .IP "\fB-p \fIpasswd\fR"
101 The encrypted password, as returned by \fBcrypt\fR(3).
102 The default is to disable the account.
103 .IP "\fB-s \fIshell\fR"
104 The name of the user's login shell.
105 The default is to leave this field blank, which causes the system
106 to select the default login shell.
107 .IP "\fB-u \fIuid\fR"
108 The numerical value of the user's ID.
109 This value must be unique, unless the \fI-o\fR option is used.
110 The value must be non-negative.
111 The default is to use the smallest ID value greater than 99 and
112 greater than every other user.
113 Values between 0 and 99 are typically reserved for system accounts.
114 .SS Changing the default values
115 When invoked with the \fB-D\fR option, \fBuseradd\fR will either
116 display the current default values, or update the default values
117 from the command line.
118 The valid options are
119 .IP "\fB-b \fIdefault_home\fR"
120 The initial path prefix for a new user's home directory.
121 The user's name will be affixed to the end of \fIdefault_home\fR
122 to create the new directory name if the \fB-d\fI option is not
123 used when creating a new account.
124 .IP "\fB-e \fIdefault_expire_date\fR"
125 The date on which the user account is disabled.
126 .IP "\fB-f \fIdefault_inactive\fR"
127 The number of days after a password has expired before the
128 account will be disabled.
129 .IP "\fB-g \fIdefault_group\fR"
130 The group name or ID for a new user's initial group.
131 The named group must exist, and a numerical group ID must have
132 an existing entry .
133 .IP "\fB-s \fIdefault_shell\fR"
134 The name of the new user's login shell.
135 The named program will be used for all future new user accounts.
136 .PP
137 If no options are specified, \fBuseradd\fR displays the current
138 default values.
139 .SH NOTES
140 The system administrator is responsible for placing the default
141 user files in the \fI/etc/skel\fR directory.
142 .SH CAVEATS
143 You may not add a user to an NIS group.
144 This must be performed on the NIS server.
145 .SH FILES
146 /etc/passwd \- user account information
147 .br
148 /etc/shadow \- secure user account information
149 .br
150 /etc/group \- group information
151 .br
152 /etc/default/useradd \- default information
153 .br
154 /etc/skel \- directory containing default files
155 .SH SEE ALSO
156 .BR chfn (1),
157 .BR chsh (1),
158 .BR passwd (1),
159 .BR crypt (3),
160 .BR groupadd (8),
161 .BR groupdel (8),
162 .BR groupmod (8),
163 .BR userdel (8),
164 .BR usermod (8)
165 .SH AUTHOR
166 Julianne Frances Haugh (jockgrrl@ix.netcom.com)