A Linux administrator needs to ensure that all new user accounts are created with a default Documents directory and a .bash_aliases file in their home directory. Which of the following is the standard and most efficient method to automate this process?
Create a template user, and then manually copy the contents of the template user's home directory each time a new user is added.
Add mkdir ~/Documents and touch ~/.bash_aliases commands to the /etc/profile file.
Place a Documents directory and a .bash_aliases file into the /etc/skel directory.
Store the Documents directory and the .bash_aliases file in the /etc/default/useradd file.
The correct method is to place the template files and directories into /etc/skel. The useradd command automatically copies the contents of the /etc/skel directory to a new user's home directory upon creation. This provides a standardized initial environment for all new users.
Modifying /etc/profile is incorrect because this script is executed at user login, not at user creation. It would attempt to create the files and directory every time any user logs in, which is inefficient and not the intended purpose.
Storing files in /etc/default/useradd is incorrect. This file is used to set default options for the useradd command, such as the default shell or home directory path, not to store files that will be copied to the new user's home directory.
Manually copying files from a template user is inefficient, not automated, and prone to human error. The /etc/skel directory is designed specifically for this automated purpose.
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
Why is `/etc/profile` not suitable for creating default user files?
Open an interactive chat with Bash
What does the `/etc/default/useradd` file configure?
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...
IT & Cybersecurity Package Join Premium for Full Access