1 |
perry |
1 |
USERADD |
|
|
2 |
!!!USERADD |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
NOTES |
|
|
7 |
CAVEATS |
|
|
8 |
FILES |
|
|
9 |
SEE ALSO |
|
|
10 |
AUTHOR |
|
|
11 |
---- |
|
|
12 |
!!NAME |
|
|
13 |
|
|
|
14 |
|
|
|
15 |
useradd - Create a new user or update default new user information |
|
|
16 |
!!SYNOPSIS |
|
|
17 |
|
|
|
18 |
|
|
|
19 |
__useradd__ |
|
|
20 |
|
|
|
21 |
|
|
|
22 |
[[__-c__ ''comment''] [[__-d__ ''home_dir''] |
|
|
23 |
[[__-e__ ''expire_date''] [[__-f__ |
|
|
24 |
''inactive_time''] |
|
|
25 |
[[__-g__ ''initial_group''] [[__-G__ |
|
|
26 |
''group''[[,...]] |
|
|
27 |
[[__-m__ [[__-k__ ''skeleton_dir'']] [[__-p__ |
|
|
28 |
''passwd''] |
|
|
29 |
[[__-s__ ''shell''] [[__-u__ ''uid'' [[ __-o__]] |
|
|
30 |
''login'' |
|
|
31 |
|
|
|
32 |
|
|
|
33 |
__useradd__ |
|
|
34 |
|
|
|
35 |
|
|
|
36 |
__-D__ [[__-g__ ''default_group''] [[__-b__ |
|
|
37 |
''default_home''] |
|
|
38 |
[[__-f__ ''default_inactive''] [[__-e__ |
|
|
39 |
''default_expire_date''] |
|
|
40 |
[[__-s__ ''default_shell''] |
|
|
41 |
!!DESCRIPTION |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
__Creating New Users__ |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
When invoked without the __-D__ option, the |
|
|
48 |
__useradd__ command creates a new user account using the |
|
|
49 |
values specified on the command line and the default values |
|
|
50 |
from the system. The new user account will be entered into |
|
|
51 |
the system files as needed, the home directory will be |
|
|
52 |
created, and initial files copied, depending on the command |
|
|
53 |
line options. The options which apply to the __useradd__ |
|
|
54 |
command are |
|
|
55 |
|
|
|
56 |
|
|
|
57 |
__-c__ ''comment'' |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
The new user's password file comment field. |
|
|
61 |
|
|
|
62 |
|
|
|
63 |
__-d__ ''home_dir'' |
|
|
64 |
|
|
|
65 |
|
|
|
66 |
The new user will be created using ''home_dir'' as the |
|
|
67 |
value for the user's login directory. The default is to |
|
|
68 |
append the ''login'' name to ''default_home'' and use |
|
|
69 |
that as the login directory name. |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
__-e__ ''expire_date'' |
|
|
73 |
|
|
|
74 |
|
|
|
75 |
The date on which the user account will be disabled. The |
|
|
76 |
date is specified in the format |
|
|
77 |
''YYYY-MM-DD''. |
|
|
78 |
|
|
|
79 |
|
|
|
80 |
__-f__ ''inactive_days'' |
|
|
81 |
|
|
|
82 |
|
|
|
83 |
The number of days after a password expires until the |
|
|
84 |
account is permanently disabled. A value of 0 disables the |
|
|
85 |
account as soon as the password has expired, and a value of |
|
|
86 |
-1 disables the feature. The default value is |
|
|
87 |
-1. |
|
|
88 |
|
|
|
89 |
|
|
|
90 |
__-g__ ''initial_group'' |
|
|
91 |
|
|
|
92 |
|
|
|
93 |
The group name or number of the user's initial login group. |
|
|
94 |
The group name must exist. A group number must refer to an |
|
|
95 |
already existing group. The default group number is |
|
|
96 |
1. |
|
|
97 |
|
|
|
98 |
|
|
|
99 |
__-G__ ''group,[[...]'' |
|
|
100 |
|
|
|
101 |
|
|
|
102 |
A list of supplementary groups which the user is also a |
|
|
103 |
member of. Each group is separated from the next by a comma, |
|
|
104 |
with no intervening whitespace. The groups are subject to |
|
|
105 |
the same restrictions as the group given with the __-g__ |
|
|
106 |
option. The default is for the user to belong only to the |
|
|
107 |
initial group. |
|
|
108 |
|
|
|
109 |
|
|
|
110 |
__-m__ |
|
|
111 |
|
|
|
112 |
|
|
|
113 |
The user's home directory will be created if it does not |
|
|
114 |
exist. The files contained in ''skeleton_dir'' will be |
|
|
115 |
copied to the home directory if the __-k__ option is |
|
|
116 |
used, otherwise the files contained in ''/etc/skel'' will |
|
|
117 |
be used instead. Any directories contained in |
|
|
118 |
''skeleton_dir'' or ''/etc/skel'' will be created in |
|
|
119 |
the user's home directory as well. The __-k__ option is |
|
|
120 |
only valid in conjunction with the __-m__ option. The |
|
|
121 |
default is to not create the directory and to not copy any |
|
|
122 |
files. |
|
|
123 |
|
|
|
124 |
|
|
|
125 |
__-p__ ''passwd'' |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
The encrypted password, as returned by crypt(3). The |
|
|
129 |
default is to disable the account. |
|
|
130 |
|
|
|
131 |
|
|
|
132 |
__-s__ ''shell'' |
|
|
133 |
|
|
|
134 |
|
|
|
135 |
The name of the user's login shell. The default is to leave |
|
|
136 |
this field blank, which causes the system to select the |
|
|
137 |
default login shell. |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
__-u__ ''uid'' |
|
|
141 |
|
|
|
142 |
|
|
|
143 |
The numerical value of the user's ID. This value must be |
|
|
144 |
unique, unless the ''-o'' option is used. The value must |
|
|
145 |
be non-negative. The default is to use the smallest ID value |
|
|
146 |
greater than 99 and greater than every other user. Values |
|
|
147 |
between 0 and 99 are typically reserved for system |
|
|
148 |
accounts. |
|
|
149 |
|
|
|
150 |
|
|
|
151 |
__Changing the default values__ |
|
|
152 |
|
|
|
153 |
|
|
|
154 |
When invoked with the __-D__ option, __useradd__ will |
|
|
155 |
either display the current default values, or update the |
|
|
156 |
default values from the command line. The valid options |
|
|
157 |
are |
|
|
158 |
|
|
|
159 |
|
|
|
160 |
__-b__ ''default_home'' |
|
|
161 |
|
|
|
162 |
|
|
|
163 |
The initial path prefix for a new user's home directory. The |
|
|
164 |
user's name will be affixed to the end of |
|
|
165 |
''default_home'' to create the new directory name if the |
|
|
166 |
__-d__ ''option is not used when creating a new |
|
|
167 |
account.'' |
|
|
168 |
|
|
|
169 |
|
|
|
170 |
__-e__ ''default_expire_date'' |
|
|
171 |
|
|
|
172 |
|
|
|
173 |
The date on which the user account is disabled. |
|
|
174 |
|
|
|
175 |
|
|
|
176 |
__-f__ ''default_inactive'' |
|
|
177 |
|
|
|
178 |
|
|
|
179 |
The number of days after a password has expired before the |
|
|
180 |
account will be disabled. |
|
|
181 |
|
|
|
182 |
|
|
|
183 |
__-g__ ''default_group'' |
|
|
184 |
|
|
|
185 |
|
|
|
186 |
The group name or ID for a new user's initial group. The |
|
|
187 |
named group must exist, and a numerical group ID must have |
|
|
188 |
an existing entry . |
|
|
189 |
|
|
|
190 |
|
|
|
191 |
__-s__ ''default_shell'' |
|
|
192 |
|
|
|
193 |
|
|
|
194 |
The name of the new user's login shell. The named program |
|
|
195 |
will be used for all future new user accounts. |
|
|
196 |
|
|
|
197 |
|
|
|
198 |
If no options are specified, __useradd__ displays the |
|
|
199 |
current default values. |
|
|
200 |
!!NOTES |
|
|
201 |
|
|
|
202 |
|
|
|
203 |
The system administrator is responsible for placing the |
|
|
204 |
default user files in the ''/etc/skel'' |
|
|
205 |
directory. |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
The __adduser__ program is generally more friendly to use |
|
|
209 |
than this one and also uses Debian policy conformant UID and |
|
|
210 |
GID values, creating a home directory a with skeletal |
|
|
211 |
configuration, running a custom script, and other features. |
|
|
212 |
It is more prefered than using this program. |
|
|
213 |
!!CAVEATS |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
You may not add a user to an NIS group. This must be |
|
|
217 |
performed on the NIS server. |
|
|
218 |
!!FILES |
|
|
219 |
|
|
|
220 |
|
|
|
221 |
/etc/passwd - user account information |
|
|
222 |
/etc/shadow - secure user account information |
|
|
223 |
/etc/group - group information |
|
|
224 |
/etc/default/useradd - default information |
|
|
225 |
/etc/skel - directory containing default files |
|
|
226 |
!!SEE ALSO |
|
|
227 |
|
|
|
228 |
|
|
|
229 |
chfn(1), chsh(1), crypt(3), |
|
|
230 |
groupadd(8), groupdel(8), groupmod(8), |
|
|
231 |
passwd(1), userdel(8), |
|
|
232 |
usermod(8) |
|
|
233 |
!!AUTHOR |
|
|
234 |
|
|
|
235 |
|
|
|
236 |
Julianne Frances Haugh (jfh@austin.ibm.com) |
|
|
237 |
---- |