Prev | Current Page 347 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"


In creating the account for mary, the useradd command performs several actions:
 Reads the /etc/login.defs file to get default values to use when creating accounts.
 Checks command-line parameters to find out which default values to override.
 Creates a new user entry in the /etc/passwd and /etc/shadow files based on the
default values and command-line parameters.
 Creates any new group entries in the /etc/group file. (Fedora creates a group using the
new user??™s name; Gentoo adds the user to the users group; and SUSE adds it to every
group you set for new users, such as dialout, audio, video, and other services.)
 Creates a home directory, based on the user??™s name, in the /home directory.
 Copies any files located within the /etc/skel directory to the new home directory. This
usually includes login and application startup scripts.
The preceding example uses only a few of the available useradd options. Most account settings
are assigned using default values. You can set more values explicitly, if you want to; here??™s an
example that uses a few more options to do so:
# useradd -g users -G wheel,apache -s /bin/tcsh -c ???Mary Smith??? mary
In this case, useradd is told to make users the primary group mary belongs to (-g), add her to
the wheel and apache groups, and assign tcsh as her primary command shell (-s).


Pages:
335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359