While standardizing new local user environments on a Linux server, you prepare customized copies of .bashrc and .vimrc that should exist as real files inside every future user's home directory. You want the files to be created automatically whenever administrators run "useradd -m" without adding post-creation scripts or extra command-line options. Which action will achieve this goal?
Copy the prepared template files into /etc/skel so useradd duplicates them into the new user's home directory during account creation.
Set a SKEL entry in /etc/login.defs to /home/company_skel and place the templates in that directory.
Add commands in /etc/profile that source the templates from a shared location whenever an interactive shell starts.
Append the file names to a COPY_FILES variable in /etc/default/useradd so that useradd copies them after it creates the account.
The useradd command copies everything found in the skeleton directory into the new user's home when the home is created with the -m option. By default the skeleton directory is /etc/skel, as defined by the SKEL variable in /etc/default/useradd. Therefore, placing the prepared .bashrc and .vimrc inside /etc/skel guarantees that each new account receives its own copies of the files with no further steps.
Adding lines to /etc/profile only makes shells source a shared file at login; it does not place files in the user's home. A non-existent COPY_FILES variable is never read by useradd, so it has no effect. Finally, /etc/login.defs does not contain a SKEL setting, so pointing that file at another directory would not influence account creation.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is the purpose of the /etc/skel directory in Linux?
Open an interactive chat with Bash
How does the -m option in the useradd command affect account creation?
Open an interactive chat with Bash
What is the difference between /etc/skel and /etc/profile in Linux?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
Pass with Confidence.
IT & Cybersecurity Package
You have hit the limits of our free tier, become a Premium Member today for unlimited access.
Military, Healthcare worker, Gov. employee or Teacher? See if you qualify for a Community Discount.
Monthly
$19.99
$19.99/mo
Billed monthly, Cancel any time.
3 Month Pass
$44.99
$14.99/mo
One time purchase of $44.99, Does not auto-renew.
MOST POPULAR
Annual Pass
$119.99
$9.99/mo
One time purchase of $119.99, Does not auto-renew.
BEST DEAL
Lifetime Pass
$189.99
One time purchase, Good for life.
What You Get
All IT & Cybersecurity Package plans include the following perks and exams .