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