CompTIA Linux+ XK0-006 Practice Test 39
Question 380
A Linux host has not yet addressed this problem: A shell deployment script needs to choose different behavior depending on an environment variable. What is the MOST direct failure or security risk?
- Copying a shell-style brace into Python without consistent indentation will not repair block structure
- Deleting the secret from the latest checkout does not revoke its copies in prior commits or clones
- Deploying by a floating branch name can install later unapproved changes during a rollback
- Treating an unset environment variable as a valid production target can deploy to the wrong location
Explanation
Correct Answer
D:Treating an unset environment variable as a valid production target can deploy to the wrong location. This follows from the underlying Linux mechanism: Bash conditional expressions and case statements select operations based on evaluated string or numeric values. A targeted remedy is to use a tested if or case branch with an explicit allowed-value check and a safe default. After correction, a useful verification is that the script accepts documented environment names and rejects unrecognized values before changes.
Incorrect Answers
A:Copying a shell-style brace into Python without consistent indentation will not repair block structure can be a concern in another case, for example when a Python function stops with an IndentationError after an engineer adds a nested condition. The described Linux condition instead directly exposes this risk: treating an unset environment variable as a valid production target can deploy to the wrong location.
B:Deleting the secret from the latest checkout does not revoke its copies in prior commits or clones can be a concern in another case, for example when a security team accidentally committed an API secret and wants to hide it with a later deletion commit. The described Linux condition instead directly exposes this risk: treating an unset environment variable as a valid production target can deploy to the wrong location.
C:Deploying by a floating branch name can install later unapproved changes during a rollback can be a concern in another case, for example when a release engineer needs to reproduce the exact automation version installed on a production server. The described Linux condition instead directly exposes this risk: treating an unset environment variable as a valid production target can deploy to the wrong location.
Question 381
For this Linux+ scenario, A developer modifies a Linux automation playbook but a required new template file is missing from the proposed commit, the planned fix is to stage the new file explicitly and inspect git status and staged diff before committing. Why will that fix work?
- Git tracks staged changes in the index separately from modifications present only in the working tree
- git stash can temporarily store working-tree and index modifications independently of branch history
- External AI service prompts may cross organizational security boundaries and should not contain sensitive secrets
- Responsible AI use requires a human to reconcile generated suggestions with actual security requirements
Explanation
Correct Answer
A:Git tracks staged changes in the index separately from modifications present only in the working tree. That is the key operating principle behind the selected remediation, stage the new file explicitly and inspect git status and staged diff before committing. The distinction matters because assuming every local untracked file is automatically included in a commit can break deployments. An appropriate observable outcome is that git show for the approved commit contains both the playbook edit and its required template.
Incorrect Answers
B:git stash can temporarily store working-tree and index modifications independently of branch history is a valid explanation for another Linux operation, such as when an administrator needs to update a feature branch while preserving unrelated uncommitted local changes. The principle here is that Git tracks staged changes in the index separately from modifications present only in the working tree.
C:External AI service prompts may cross organizational security boundaries and should not contain sensitive secrets is a valid explanation for another Linux operation, such as when a developer pastes a production SSH private key into a public AI chatbot to debug an authentication issue. The principle here is that Git tracks staged changes in the index separately from modifications present only in the working tree.
D:Responsible AI use requires a human to reconcile generated suggestions with actual security requirements is a valid explanation for another Linux operation, such as when an administrator asks a model to create a Linux hardening policy that conflicts with the organization's approved controls. The principle here is that Git tracks staged changes in the index separately from modifications present only in the working tree.
Question 382
A production Linux host has this unresolved condition: A custom systemd service exits immediately and supervisors cannot tell why it failed. What should the administrator do FIRST?
- Configure an appropriate persistent timer and corresponding oneshot service with verified calendar settings
- Inspect systemctl status and journalctl -u output before modifying the service unit
- Inspect process nice levels and adjust priority with renice under approved permission controls
- Check the path with lsof and resolve the owning process before retrying the maintenance step
Explanation
Correct Answer
B:Inspect systemctl status and journalctl -u output before modifying the service unit. This directly addresses the stated Linux administration condition because systemd unit state and journal records link process exit status to activation attempts. If the underlying problem is ignored, randomly changing Restart settings can cause a crash loop while hiding the original error. Verify the fix by confirming that the unit starts successfully after the diagnosed failure is fixed and clean logs show normal readiness.
Incorrect Answers
A:Configure an appropriate persistent timer and corresponding oneshot service with verified calendar settings could be useful for a different Linux requirement, for example when a periodic backup job needs a systemd timer that runs after a host was powered off overnight. In the current condition, the effective action is to inspect systemctl status and journalctl -u output before modifying the service unit.
C:Inspect process nice levels and adjust priority with renice under approved permission controls could be useful for a different Linux requirement, for example when a process has lower priority than intended and competes with critical interactive services. In the current condition, the effective action is to inspect systemctl status and journalctl -u output before modifying the service unit.
D:Check the path with lsof and resolve the owning process before retrying the maintenance step could be useful for a different Linux requirement, for example when a log-rotation process cannot delete an archived file because another process still has it open. In the current condition, the effective action is to inspect systemctl status and journalctl -u output before modifying the service unit.
Question 383
During a Linux service review, the team discovers: An application handshake stalls across a VPN although small pings and route lookups succeed. Which corrective action should be selected?
- Synchronize host time and include a consistent timestamp and host identity in collected events
- Correlate packet loss and latency percentiles with interface queues and bursts instead of relying on mean throughput
- Investigate MTU and MSS with suitable path probes and packet captures then correct the route or tunnel settings
- Validate the server's SSH host public key out of band and update known_hosts only after approval
Explanation
Correct Answer
C:Investigate MTU and MSS with suitable path probes and packet captures then correct the route or tunnel settings. This directly addresses the stated Linux administration condition because encapsulation overhead can make the effective path MTU smaller than the physical interface MTU. If the underlying problem is ignored, treating successful small ICMP tests as proof of large TCP payload delivery can hide a black-hole issue. Verify the fix by confirming that a large encrypted application transfer completes without repeated TCP retransmission.
Incorrect Answers
A:Synchronize host time and include a consistent timestamp and host identity in collected events could be useful for a different Linux requirement, for example when a log pipeline reports a Linux service crash but its event timestamps are inconsistent across three hosts. In the current condition, the effective action is to investigate MTU and MSS with suitable path probes and packet captures then correct the route or tunnel settings.
B:Correlate packet loss and latency percentiles with interface queues and bursts instead of relying on mean throughput could be useful for a different Linux requirement, for example when a video-call workload across a Linux gateway suffers jitter and intermittent packet drops while bandwidth averages look normal. In the current condition, the effective action is to investigate MTU and MSS with suitable path probes and packet captures then correct the route or tunnel settings.
D:Validate the server's SSH host public key out of band and update known_hosts only after approval could be useful for a different Linux requirement, for example when a Linux SSH client rejects an internal server after its SSH host-key fingerprint changed unexpectedly. In the current condition, the effective action is to investigate MTU and MSS with suitable path probes and packet captures then correct the route or tunnel settings.
Question 384
An administrator chooses to create an LVM physical volume on the intended disk and extend the correct volume group because of this Linux issue: An administrator adds a disk to a volume group but LVM still reports no new physical extents. Which technical principle BEST explains the remediation?
- Open-source license families impose different obligations when modified or combined software is redistributed
- Line-oriented text filters can match patterns and transform selected records without rewriting unrelated data
- Copy-on-write overlay chains can add storage and performance cost as snapshots accumulate
- LVM consumes initialized physical volumes inside a volume group rather than arbitrary unprepared block devices
Explanation
Correct Answer
D:LVM consumes initialized physical volumes inside a volume group rather than arbitrary unprepared block devices. That is the key operating principle behind the selected remediation, create an LVM physical volume on the intended disk and extend the correct volume group. The distinction matters because running lvextend before registering the new physical volume cannot allocate space that the group does not own. An appropriate observable outcome is that pvs and vgs show the expected new physical volume and available extents.
Incorrect Answers
A:Open-source license families impose different obligations when modified or combined software is redistributed is a valid explanation for another Linux operation, such as when a vendor proposes combining proprietary redistribution restrictions with copyleft-licensed source without a review. The principle here is that LVM consumes initialized physical volumes inside a volume group rather than arbitrary unprepared block devices.
B:Line-oriented text filters can match patterns and transform selected records without rewriting unrelated data is a valid explanation for another Linux operation, such as when an engineer must replace only matching lines in a large configuration inventory while leaving others untouched. The principle here is that LVM consumes initialized physical volumes inside a volume group rather than arbitrary unprepared block devices.
C:Copy-on-write overlay chains can add storage and performance cost as snapshots accumulate is a valid explanation for another Linux operation, such as when a VM running under libvirt shows excessive storage overhead from a long chain of unmerged snapshots. The principle here is that LVM consumes initialized physical volumes inside a volume group rather than arbitrary unprepared block devices.
Question 385
For this Linux+ scenario, A shared project directory needs new files to inherit its group without making all users world-writable, the planned fix is to set the correct group ownership and directory setgid bit with an appropriate collaborative umask. Why will that fix work?
- A directory setgid bit causes new contained objects to inherit that directory's group under normal creation
- LUKS2 protects at-rest block content using protected volume keys that are unlocked at authorized boot or mount
- File integrity monitoring compares recorded cryptographic attributes and metadata with current filesystem state
- SELinux mandatory access controls enforce object types independently of DAC mode bits
Explanation
Correct Answer
A:A directory setgid bit causes new contained objects to inherit that directory's group under normal creation. That is the key operating principle behind the selected remediation, set the correct group ownership and directory setgid bit with an appropriate collaborative umask. The distinction matters because setting global write permissions instead of group inheritance unnecessarily exposes project data. An appropriate observable outcome is that new test files inherit the approved group and unauthorized users cannot modify them.
Incorrect Answers
B:LUKS2 protects at-rest block content using protected volume keys that are unlocked at authorized boot or mount is a valid explanation for another Linux operation, such as when a laptop holds confidential data on an unencrypted ext4 filesystem and may be stolen during travel. The principle here is that a directory setgid bit causes new contained objects to inherit that directory's group under normal creation.
C:File integrity monitoring compares recorded cryptographic attributes and metadata with current filesystem state is a valid explanation for another Linux operation, such as when an organization needs to detect unexpected changes to critical binaries on production Linux hosts. The principle here is that a directory setgid bit causes new contained objects to inherit that directory's group under normal creation.
D:SELinux mandatory access controls enforce object types independently of DAC mode bits is a valid explanation for another Linux operation, such as when a web root was copied from another filesystem and SELinux now denies access despite correct Unix permissions. The principle here is that a directory setgid bit causes new contained objects to inherit that directory's group under normal creation.
Question 386
The team proposes to compare kernel version and module availability and rebuild the appropriate initramfs for that version after observing A Linux system fails to load a required storage driver after a kernel package update. Which Linux behavior supports the change?
- Boot-time root discovery depends on matching the declared identifier to an available block filesystem
- Kernel module ABI and early-boot driver packaging must match the kernel selected by the bootloader
- Event-driven monitoring integrations may deliver repeats and need robust receiver semantics
- High I/O wait or storage service time can dominate latency even when processor cycles are available
Explanation
Correct Answer
B:Kernel module ABI and early-boot driver packaging must match the kernel selected by the bootloader. That is the key operating principle behind the selected remediation, compare kernel version and module availability and rebuild the appropriate initramfs for that version. The distinction matters because installing a module for another kernel release may not make it loadable at startup. An appropriate observable outcome is that the new kernel enumerates the device and the expected storage mount becomes available.
Incorrect Answers
A:Boot-time root discovery depends on matching the declared identifier to an available block filesystem is a valid explanation for another Linux operation, such as when a Linux machine drops into an initramfs shell and reports that the root filesystem UUID cannot be found. The principle here is that Kernel module ABI and early-boot driver packaging must match the kernel selected by the bootloader.
C:Event-driven monitoring integrations may deliver repeats and need robust receiver semantics is a valid explanation for another Linux operation, such as when a webhook-based incident automation triggers several identical repair jobs for the same monitoring event. The principle here is that Kernel module ABI and early-boot driver packaging must match the kernel selected by the bootloader.
D:High I/O wait or storage service time can dominate latency even when processor cycles are available is a valid explanation for another Linux operation, such as when a Linux application has slow response times while top shows CPUs idle but iostat reports high await. The principle here is that Kernel module ABI and early-boot driver packaging must match the kernel selected by the bootloader.
Question 387
During a Linux service review, the team discovers: An emergency support account has an interactive shell even though it should only exist for an application process. Which corrective action should be selected?
- Apply an approved PAM password-quality and expiration policy then test compliant changes
- Set the correct group ownership and directory setgid bit with an appropriate collaborative umask
- Assign a non-login shell and minimize the service identity's local and remote access rights
- Restore a tested PAM configuration and identify the broken auth or account stack entry
Explanation
Correct Answer
C:Assign a non-login shell and minimize the service identity's local and remote access rights. This directly addresses the stated Linux administration condition because a shell such as /usr/sbin/nologin can refuse ordinary interactive sessions for accounts that need none. If the underlying problem is ignored, giving unnecessary interactive access to service identities can enable privilege abuse after credential disclosure. Verify the fix by confirming that the daemon still runs as the account but interactive login attempts are refused.
Incorrect Answers
A:Apply an approved PAM password-quality and expiration policy then test compliant changes could be useful for a different Linux requirement, for example when a privileged local account can reuse the same weak password indefinitely without expiry. In the current condition, the effective action is to assign a non-login shell and minimize the service identity's local and remote access rights.
B:Set the correct group ownership and directory setgid bit with an appropriate collaborative umask could be useful for a different Linux requirement, for example when a shared project directory needs new files to inherit its group without making all users world-writable. In the current condition, the effective action is to assign a non-login shell and minimize the service identity's local and remote access rights.
D:Restore a tested PAM configuration and identify the broken auth or account stack entry could be useful for a different Linux requirement, for example when an administrator changes PAM rules and all SSH users lose access even though their passwords remain valid. In the current condition, the effective action is to assign a non-login shell and minimize the service identity's local and remote access rights.
Question 388
After applying the relevant Linux fix for A system administrator needs to append nightly results to a report without destroying previous records, which evidence BEST demonstrates success?
- The rescue map documents recovered extents and the saved image is mounted read-only for validation
- The guest starts with KVM acceleration and shows expected virtual hardware
- A documented legal and technical review approves a compliant packaging and source-disclosure approach
- Two successive runs retain earlier records and append only their new report lines
Explanation
Correct Answer
D:Two successive runs retain earlier records and append only their new report lines. This outcome directly tests whether the Linux operation, use shell append redirection or tee -a rather than output truncation when writing the report, addresses the specified failure. The technical reason is that a single greater-than operator truncates a file whereas double greater-than appends to its contents. Without correcting the underlying issue, accidentally truncating the audit report can remove historic evidence needed by operations.
Incorrect Answers
A:The rescue map documents recovered extents and the saved image is mounted read-only for validation might confirm success for a different Linux problem, such as when a disk contains unreadable sectors and an administrator tries to copy it repeatedly using dd. Here the required evidence is that two successive runs retain earlier records and append only their new report lines.
B:The guest starts with KVM acceleration and shows expected virtual hardware might confirm success for a different Linux problem, such as when a Linux lab must use hardware-assisted guest virtualization instead of emulating every CPU instruction. Here the required evidence is that two successive runs retain earlier records and append only their new report lines.
C:A documented legal and technical review approves a compliant packaging and source-disclosure approach might confirm success for a different Linux problem, such as when a vendor proposes combining proprietary redistribution restrictions with copyleft-licensed source without a review. Here the required evidence is that two successive runs retain earlier records and append only their new report lines.
Question 389
A Linux+ operations scenario reports: An Apache process reads a web file only when SELinux is set permissive despite correct traditional permissions. Which remediation is MOST appropriate?
- Inspect denial audit messages and restore or define the correct persistent SELinux file context
- Compare boot arguments and /etc/fstab UUID entries against blkid then repair the incorrect reference
- Configure sustained threshold durations and actionable alert routing based on a measured normal baseline
- Document which agent-based and agentless measurements are required for each service health objective
Explanation
Correct Answer
A:Inspect denial audit messages and restore or define the correct persistent SELinux file context. This directly addresses the stated Linux administration condition because SELinux type enforcement can block access even when discretionary file permissions allow a read. If the underlying problem is ignored, permanently disabling SELinux to bypass one incorrect label weakens broader service confinement. Verify the fix by confirming that the site works in enforcing mode and the expected label is visible with ls -Z.
Incorrect Answers
B:Compare boot arguments and /etc/fstab UUID entries against blkid then repair the incorrect reference could be useful for a different Linux requirement, for example when a Linux machine drops into an initramfs shell and reports that the root filesystem UUID cannot be found. In the current condition, the effective action is to inspect denial audit messages and restore or define the correct persistent SELinux file context.
C:Configure sustained threshold durations and actionable alert routing based on a measured normal baseline could be useful for a different Linux requirement, for example when an infrastructure monitor sends an alert on every ordinary CPU spike and overwhelms the on-call team. In the current condition, the effective action is to inspect denial audit messages and restore or define the correct persistent SELinux file context.
D:Document which agent-based and agentless measurements are required for each service health objective could be useful for a different Linux requirement, for example when a Linux operations team has agents on half its servers while the others are only pinged externally. In the current condition, the effective action is to inspect denial audit messages and restore or define the correct persistent SELinux file context.
Question 390
An operations team leaves this Linux condition unchanged: A NetworkManager host loses its manually assigned IPv4 address each time the interface reconnects. Which adverse consequence is MOST likely?
- Counting lines before removing duplicates can overstate the number of distinct user entries
- Applying a one-time ip addr add command can disappear at reboot and reintroduce the outage
- Modifying an unrelated application service cannot repair a missing or invalid kernel boot entry
- Forcing a single kernel object without its prerequisites can fail or leave the hardware unavailable
Explanation
Correct Answer
B:Applying a one-time ip addr add command can disappear at reboot and reintroduce the outage. This follows from the underlying Linux mechanism: ephemeral ip address changes do not replace persistent network connection configuration. A targeted remedy is to edit the correct NetworkManager connection profile with nmcli and reactivate it after verifying addressing. After correction, a useful verification is that nmcli and ip address show the approved address after reconnect and reboot.
Incorrect Answers
A:Counting lines before removing duplicates can overstate the number of distinct user entries can be a concern in another case, for example when a shell audit report must list unique users from the first field of a colon-delimited account file. The described Linux condition instead directly exposes this risk: applying a one-time ip addr add command can disappear at reboot and reintroduce the outage.
C:Modifying an unrelated application service cannot repair a missing or invalid kernel boot entry can be a concern in another case, for example when a UEFI Linux server stops before loading its kernel after its bootloader configuration is changed. The described Linux condition instead directly exposes this risk: applying a one-time ip addr add command can disappear at reboot and reintroduce the outage.
D:Forcing a single kernel object without its prerequisites can fail or leave the hardware unavailable can be a concern in another case, for example when a newly installed kernel module has unresolved dependencies when loaded manually with insmod. The described Linux condition instead directly exposes this risk: applying a one-time ip addr add command can disappear at reboot and reintroduce the outage.