nerdexam
CompTIA

XK0-005 · Question #337

A Linux administrator wants to include a standard, hash_profile file whenever a new local user is created on Linux server. Which of the following is the BEST location to place the file?

The correct answer is B. /etc/skel/. The /etc/skel/ directory is the standard location for template files that are copied to a new user's home directory upon creation, ensuring a consistent initial setup.

System Management

Question

A Linux administrator wants to include a standard, hash_profile file whenever a new local user is created on Linux server. Which of the following is the BEST location to place the file?

Options

  • A/User/local/
  • B/etc/skel/
  • C/etc/profile.d/
  • D/Home/default_user/

How the community answered

(31 responses)
  • A
    3% (1)
  • B
    94% (29)
  • D
    3% (1)

Why each option

The /etc/skel/ directory is the standard location for template files that are copied to a new user's home directory upon creation, ensuring a consistent initial setup.

A/User/local/

/usr/local/ is typically used for locally compiled software or data that is not part of the distribution, not for user home directory templates.

B/etc/skel/Correct

The /etc/skel/ directory serves as a template for new user home directories. When a new user account is created using useradd or similar tools, the contents of /etc/skel/ are copied to the new user's home directory. Placing a standard configuration file like .bash_profile here ensures every new user automatically receives it in their home directory.

C/etc/profile.d/

/etc/profile.d/ contains shell scripts that are executed by /etc/profile for all users at login, but it does not provide template files for individual user home directories.

D/Home/default_user/

/home/default_user/ is not a standard system directory for user templates; /etc/skel/ is the designated location for this purpose.

Concept tested: Linux user management, User profile templates

Source: https://man7.org/linux/man-pages/man5/skel.5.html

Topics

#User Management#Configuration Files#Filesystem Hierarchy

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice