Make a common .profile and initial configuration copy into future homes created with useradd -m.
Which location should be edited?
/etc/skel stores the template copied into newly created home directories.
Detailed explanation
/etc/profile.d/Incorrect. /etc/profile.d contains system profile fragments, not home templates.
Incorrect. /etc/profile.d contains system profile fragments, not home templates.
/var/lib/users/Incorrect. /var/lib/users is not the standard user-home template.
Incorrect. /var/lib/users is not the standard user-home template.
/usr/share/home/Incorrect. /usr/share/home is not useradd's default template location.
Incorrect. /usr/share/home is not useradd's default template location.
/etc/skel/Correct. /etc/skel is copied into new homes.
Correct. /etc/skel is copied into new homes.
Try it yourself
An example you can run in a temporary verification environment.
find /etc/skel -maxdepth 1 -mindepth 1 -printf '%f\n' 2>/dev/null | sortExpected result
環境に応じて.profileや.bashrc等Key points
- Template for new homes
- Used by useradd -m
- Existing homes are unchanged
Notes
- Environment: Linux / /etc/skel読取のみ
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.