nerdexam
CompTIA

XK0-004 · 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/. NOTE - the stated correct answer (A) appears to be a question data error. The technically correct Linux answer is B: /etc/skel/ is the standard skeleton directory whose contents are automatically copied to every new user's home directory at account creation.

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

(46 responses)
  • A
    2% (1)
  • B
    89% (41)
  • C
    7% (3)
  • D
    2% (1)

Why each option

NOTE - the stated correct answer (A) appears to be a question data error. The technically correct Linux answer is B: /etc/skel/ is the standard skeleton directory whose contents are automatically copied to every new user's home directory at account creation.

A/User/local/

/User/local/ is not a valid standard Linux path (Linux paths are case-sensitive and the canonical path is /usr/local/), and neither form is consulted by user creation utilities when populating new home directories.

B/etc/skel/Correct

/etc/skel/ is the skeleton directory used by useradd and adduser - when a new local user account is created, the Linux user management tools automatically copy all files and subdirectories from /etc/skel/ into the new user's home directory. Placing a standard .bash_profile (hash_profile) file in /etc/skel/ ensures every new user inherits it without any manual steps by the administrator.

C/etc/profile.d/

/etc/profile.d/ holds shell scripts that are sourced system-wide at login to set environment variables, not a directory from which files are copied into individual user home directories.

D/Home/default_user/

/Home/default_user/ is not a recognized Linux standard directory and is not referenced by useradd or adduser as a source for new user skeleton files.

Concept tested: Linux /etc/skel skeleton directory for new user defaults

Source: https://man7.org/linux/man-pages/man8/useradd.8.html

Topics

#/etc/skel#user creation#default profile#user management

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice