Prev | Current Page 350 | Next

Christopher Negus

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

defs file. You can modify those defaults by either editing that file manually with a
standard text editor or by running the useradd command with the -D option. Although
152
Running the Show Part II
login.defs is different on different Linux systems, here is an example containing many of the
settings you might find in a login.defs file:
PASS_MAX_DAYS 99999
PASS_MIN_DAYS 0
PASS_MIN_LEN 5
PASS_WARN_AGE 7
UID_MIN 500
UID_MAX 60000
GID_MIN 500
GID_MAX 60000
CREATE_HOME yes
All uncommented lines contain keyword/value pairs. For example, the keyword PASS_MIN_LEN is
followed by some white space and the value 5. This tells useradd that the user password must be
at least five characters. Other lines let you customize the valid range of automatically assigned user
ID numbers or group ID numbers. (Fedora starts at UID 500; other Linuxes start with UID 100.) A
comment section that explains that keyword??™s purpose precedes each keyword (which I edited out
here to save space). Altering a default value is as simple as editing the value associated with a keyword
and then saving the file.
If you want to view the defaults, type the useradd command with the -D option, as follows:
# useradd -D
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
You can also use the -D option to change defaults.


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