
Mastering Linux Security and Hardening
By :

The /etc/default/useradd
file has the rest of the default settings. In this case, we’ll look at the one from the AlmaLinux 9 machine:
Ubuntu also has the useradd
configuration file, but it doesn’t work. No matter how you configure it, the Ubuntu version of useradd
just won’t read it. So, the write-up about this file only applies to Red Hat-type systems.
# useradd defaults file
GROUP=100
HOME=/home
INACTIVE=-1
EXPIRE=
SHELL=/bin/bash
SKEL=/etc/skel
CREATE_MAIL_SPOOL=yes
The EXPIRE=
line sets the default expiration date for new user accounts. By default, there is no default expiration date. INACTIVE=-1
means that user accounts won’t be automatically locked out after the users’ passwords expire. If we set this to a positive number, then any new users will have that many days to change an expired password before the account gets locked. To change the...