CompTIA XK0-006 (CompTIA Linux+) Practice Test 39

Question 380

A shared administrator password makes it impossible to attribute maintenance commands to a person. Which alternative is preferred?

  1. Run services with dedicated least-privileged identities
  2. /usr/sbin/nologin
  3. Individual named accounts with audited sudo
  4. Disable or expire the user account

Explanation

Correct Answer

C:

Named identities allow per-user authentication and privilege grants with accountability. Shared root credentials obscure attribution and complicate revocation.

Incorrect Answers

A:

Constraining service UIDs and filesystem privileges limits damage if an application is compromised; the requirement is maintaining accountable privileged administration, outside the effect of this choice.

B:

nologin refuses interactive shell sessions while allowing the account to own processes and files; it does not deliver maintaining accountable privileged administration, which is decisive in this scenario.

D:

Locking or expiring access protects the system without immediately destroying evidence; the task involves maintaining accountable privileged administration, whereas this addresses another subsystem.

Question 381

A systemd-managed daemon must not be able to modify most of the host filesystem, even where its service identity otherwise has discretionary write access. Which unit hardening directive makes the filesystem hierarchy read-only within the service mount namespace, apart from API-filesystem exceptions and explicit write allowances?

  1. ProtectSystem=strict
  2. ProtectSystem=full
  3. PrivateTmp=true
  4. NoNewPrivileges=true
  5. UMask=0027

Explanation

Correct Answer

A:

In a systemd service, ProtectSystem=strict mounts the filesystem hierarchy read-only from the unit’s perspective, with documented API filesystem exceptions. Explicit ReadWritePaths and similar settings can permit specifically approved writable paths.

Incorrect Answers

B:

ProtectSystem=full makes /usr, /boot and /etc read-only for the unit, but does not apply the broad read-only restriction to the entire ordinary filesystem hierarchy demanded by the scenario.

C:

PrivateTmp provides the unit with private temporary-directory views, isolating temporary files. It does not make the remaining filesystem read-only for the service.

D:

NoNewPrivileges prevents the service and its children from gaining additional privileges via exec transitions. It does not impose the requested read-only filesystem view.

E:

UMask sets the permission mask used when this service creates filesystem objects. It does not stop modifications to existing writable files throughout the host filesystem.

Question 382

After several bad logins, an account should experience temporary lockout under a local PAM stack. Which technique applies?

  1. Password plus a separate authenticator factor
  2. chage -M 90 username
  3. PAM password-history enforcement
  4. Prefer sufficient password length and resistance to guessing
  5. PAM failed-login counter policy

Explanation

Correct Answer

E:

A PAM module such as pam_faillock can record failed attempts and enforce temporary denial according to configuration. Avoid locking out administrative recovery paths.

Incorrect Answers

A:

Multifactor authentication combines different categories such as knowledge and possession; it will not provide slowing repeated failed local authentication attempts under these conditions.

B:

chage -M sets a maximum password age in days; using it would leave slowing repeated failed local authentication attempts unresolved.

C:

PAM modules can remember previous password hashes and reject reuse on password change; the requirement is slowing repeated failed local authentication attempts, outside the effect of this choice.

D:

Password length and unpredictability help resist brute force and dictionary attacks; it does not deliver slowing repeated failed local authentication attempts, which is decisive in this scenario.

Question 383

A privileged action requires an approval trace and should occur only when specifically authorized. Which access model supports this?

  1. Lock unused authentication methods on service accounts
  2. Retrieve secrets through a controlled secret store
  3. Just-in-time elevation with logged approvals
  4. Verify the SSH host key fingerprint

Explanation

Correct Answer

C:

Time-bounded elevation reduces standing privilege and records authorization decisions. Permanent unrestricted sudo rights would increase exposure.

Incorrect Answers

A:

Disabling unnecessary password or SSH login paths narrows attack surface; the task involves avoiding continuous administrative privilege, whereas this addresses another subsystem.

B:

A managed secret mechanism can limit access, enable rotation and avoid publishing credentials with scripts; its scope differs from avoiding continuous administrative privilege, so it cannot meet the stated requirement.

D:

Host-key checking establishes continuity of the remote server's identity; the administrator instead needs avoiding continuous administrative privilege; this option serves a different purpose.

Question 384

A backup agent's credential is exposed in a plaintext script. Which mitigation best addresses this practice?

  1. Verify the SSH host key fingerprint
  2. Lock unused authentication methods on service accounts
  3. Just-in-time elevation with logged approvals
  4. Retrieve secrets through a controlled secret store

Explanation

Correct Answer

D:

A managed secret mechanism can limit access, enable rotation and avoid publishing credentials with scripts. File mode alone does not solve secret lifecycle management.

Incorrect Answers

A:

Host-key checking establishes continuity of the remote server's identity; that changes a different part of the system; the requested outcome is removing hard-coded service credentials.

B:

Disabling unnecessary password or SSH login paths narrows attack surface; this does not achieve removing hard-coded service credentials on the system described.

C:

Time-bounded elevation reduces standing privilege and records authorization decisions; it will not provide removing hard-coded service credentials under these conditions.

Question 385

A policy requires two independent authentication factors when users reach a sensitive server. Which design meets this?

  1. chage -M 90 username
  2. Prefer sufficient password length and resistance to guessing
  3. Password plus a separate authenticator factor
  4. passwd

Explanation

Correct Answer

C:

Multifactor authentication combines different categories such as knowledge and possession. Two passwords or two PINs remain one factor category.

Incorrect Answers

A:

chage -M sets a maximum password age in days; it does not deliver requiring authentication from separate factor categories, which is decisive in this scenario.

B:

Password length and unpredictability help resist brute force and dictionary attacks; the evidence calls for requiring authentication from separate factor categories, not merely this separate operation.

D:

passwd interacts with the authentication stack to change local passwords and enforce applicable policy; its scope differs from requiring authentication from separate factor categories, so it cannot meet the stated requirement.

Question 386

A machine's service users have password hashes but do not need any network authentication. Which account security practice is appropriate?

  1. Just-in-time elevation with logged approvals
  2. Verify the SSH host key fingerprint
  3. Lock unused authentication methods on service accounts
  4. Retrieve secrets through a controlled secret store

Explanation

Correct Answer

C:

Disabling unnecessary password or SSH login paths narrows attack surface. The application can still run under its dedicated UID.

Incorrect Answers

A:

Time-bounded elevation reduces standing privilege and records authorization decisions; the administrator instead needs reducing service-account login paths; this option serves a different purpose.

B:

Host-key checking establishes continuity of the remote server's identity; it answers a neighboring question rather than reducing service-account login paths.

D:

A managed secret mechanism can limit access, enable rotation and avoid publishing credentials with scripts; this does not achieve reducing service-account login paths on the system described.

Question 387

Password changes should be blocked from reusing the last several known credentials. Which control is appropriate?

  1. chage -M 90 username
  2. PAM password-history enforcement
  3. passwd
  4. PAM failed-login counter policy

Explanation

Correct Answer

B:

PAM modules can remember previous password hashes and reject reuse on password change. Protecting history storage and coordinating policy across identity systems matters.

Incorrect Answers

A:

chage -M sets a maximum password age in days; using it would leave enforcing password history during changes unresolved.

C:

passwd interacts with the authentication stack to change local passwords and enforce applicable policy; it does not deliver enforcing password history during changes, which is decisive in this scenario.

D:

A PAM module such as pam_faillock can record failed attempts and enforce temporary denial according to configuration; the evidence calls for enforcing password history during changes, not merely this separate operation.

Question 388

A server's automation previously ran as root for all tasks. Which practice most directly reduces blast radius?

  1. Individual named accounts with audited sudo
  2. Disable or expire the user account
  3. /usr/sbin/nologin
  4. Cgroup-based service resource limits
  5. Run services with dedicated least-privileged identities

Explanation

Correct Answer

E:

Constraining service UIDs and filesystem privileges limits damage if an application is compromised. Capabilities should be added only when necessary.

Incorrect Answers

A:

Named identities allow per-user authentication and privilege grants with accountability; its scope differs from reducing routine service privileges, so it cannot meet the stated requirement.

B:

Locking or expiring access protects the system without immediately destroying evidence; that is not equivalent to reducing routine service privileges.

C:

nologin refuses interactive shell sessions while allowing the account to own processes and files; the administrator instead needs reducing routine service privileges; this option serves a different purpose.

D:

Control groups bound resource usage of process groups and can be managed by systemd; it answers a neighboring question rather than reducing routine service privileges.

Question 389

A TLS review must verify that the certificate is valid for the requested hostname AND that its validity interval has not ended. Which TWO X.509 properties answer these questions? Choose TWO.

  1. Certificate signing request (CSR)
  2. Not After timestamp
  3. Subject Alternative Name (SAN) DNS names
  4. chmod 600 server.key
  5. Configure the complete server certificate chain

Explanation

Correct Answers

B:

The X.509 Not After time is the end of a certificate's validity interval. Clients with accurate clocks reject certificates outside their valid period.

C:

The Subject Alternative Name extension contains DNS identities used by modern TLS clients to validate a requested hostname. The certificate expiration is a separate property given by the Not After validity timestamp.

Incorrect Answers

A:

A CSR contains the subject and public key and is signed with the corresponding private key; this does not achieve checking both the certificate hostname and validity end on the system described.

D:

Owner-only read/write permissions reduce accidental disclosure of a TLS private key; the requirement is checking both the certificate hostname and validity end, outside the effect of this choice.

E:

Clients may be unable to build a trusted path when intermediates are missing; it does not deliver checking both the certificate hostname and validity end, which is decisive in this scenario.

Question 390

A VPN design uses a public/private key pair per device, and private keys must never leave the endpoint. Which principle is involved?

  1. TLS 1.3
  2. Test handshake negotiation against allowed TLS versions
  3. Asymmetric key ownership
  4. WireGuard VPN
  5. SSH KexAlgorithms configuration
  6. Trusted certificate chain to an accepted authority

Explanation

Correct Answer

C:

Public keys can be distributed to peers while private keys remain secret on each endpoint. Exposing a private key enables impersonation until rotation.

Incorrect Answers

A:

TLS protects the confidentiality and integrity of a negotiated network connection while enabling certificate-based endpoint authentication; the evidence calls for securing private keys used in network authentication, not merely this separate operation.

B:

A handshake probe reveals protocol versions a listener actually accepts; the task involves securing private keys used in network authentication, whereas this addresses another subsystem.

D:

WireGuard uses modern public-key cryptography to protect layer-3 traffic over UDP; that is not equivalent to securing private keys used in network authentication.

E:

The KexAlgorithms list controls permitted SSH key-exchange mechanisms; the administrator instead needs securing private keys used in network authentication; this option serves a different purpose.

F:

TLS clients validate a chain to trusted roots unless a suitable explicit trust decision exists; it answers a neighboring question rather than securing private keys used in network authentication.

CompTIA Linux+ (XK0-006) Practice Tests