Copy common .bashrc and initial files into new home directories created by useradd.
Edit the standard template directory.
Which location is appropriate?
/etc/skel contains template files copied into new user homes; it does not update existing users automatically.
Detailed explanation
/etc/profile.dIncorrect. /etc/profile.d contains system-wide profile snippets, not home templates.
Incorrect. /etc/profile.d contains system-wide profile snippets, not home templates.
/var/libIncorrect. /var/lib stores variable application state.
Incorrect. /var/lib stores variable application state.
/usr/shareIncorrect. /usr/share is a general shared-data hierarchy.
Incorrect. /usr/share is a general shared-data hierarchy.
/etc/skelCorrect. /etc/skel is the conventional new-home template directory.
Correct. /etc/skel is the conventional new-home template directory.
Try it yourself
An example you can run in a temporary verification environment.
find /etc/skel -maxdepth 1 -mindepth 1 -printf '%f
' 2>/dev/null | sortExpected result
.bashrcや.profile等。内容はディストリビューションで異なるKey points
- Skeleton template
- Copied for new homes
- No automatic update
Notes
- Environment: Linux shadow-utils / 読み取り操作
- 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.