Prev | Current Page 348 | Next

Christopher Negus

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

A home directory
in /home under the user??™s name (/home/mary) is created by default. This command line
results in a line similar to the following being added to the /etc/passwd file:
mary:x:502:100:Mary Smith:/home/mary:/bin/tcsh
Each line in the /etc/passwd file represents a single user account record. Each field is separated
from the next by a colon (:) character. The field??™s position in the sequence determines what it is. As
you can see, the login name is first. Again, the password field contains an x because we are using a
shadow password file to store encrypted password data. The user ID selected by useradd is 502.
151
Learning Basic Administration 4
The primary group ID is 100, which corresponds to the users group in the /etc/group file. The
comment field was correctly set to Mary Smith, the home directory was automatically assigned as
/home/mary, and the command shell was assigned as /bin/tcsh, exactly as specified with the
useradd options.
By leaving out many of the options (as I did in the first useradd example), defaults are assigned
in most cases. For example, by not using -g users or -G wheel,apache, in Fedora a group
named mary would have been created and assigned to the new user. Other Linux systems assign
users as the group name by default.


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