What are the key configuration files involved in user creation?
useradd reads its defaults from /etc/default/useradd and /etc/login.defs, copies a skeleton home from /etc/skel/, then writes new entries into /etc/passwd, /etc/shadow, and /etc/group.
Knowing this map demystifies "where do the defaults come from?": shell and home-base come from /etc/default/useradd, UID/GID ranges and password-aging come from /etc/login.defs, and the starter dotfiles (.bashrc, .bash_profile) in a new home are literally copied from /etc/skel/ — so customizing /etc/skel/ gives every future user a standard setup.
Input files (defaults):
| File | Purpose |
|---|---|
/etc/default/useradd |
Default values for useradd |
/etc/login.defs |
UID/GID ranges, password aging |
/etc/skel/ |
Template for new home directories |
Output files (updated):
| File | What's added |
|---|---|
/etc/passwd |
User account entry |
/etc/shadow |
Password entry |
/etc/group |
Primary group (if created) |
/home/username/ |
Home directory (copied from skel) |
/etc/skel/ contents:
ls -la /etc/skel/
.bash_logout
.bash_profile
.bashrc
- Copied to every new user's home directory
- Customize for organization-wide defaults
View defaults:
useradd -D # Show useradd defaults
Tip: Customize /etc/skel/ to give all new users standard configurations, aliases, etc.