Topic 1: Exam Set A
Which of me following should be placed at the top of a Bash script to ensure it can be executed?
A. bash
B. !execute
C. #!
D. @eacho off
Explanation:
In a Bash script, the characters #!, known as a shebang, must be placed at the top of the script file. The shebang line specifies the path to the interpreter that should execute the script.
For a Bash script, this typically looks like:
#!/bin/bash
This line tells the operating system to use the Bash shell located at /bin/bash to interpret and run the commands within the script. Without the shebang, the system might attempt to execute the script using a different shell or environment, which could cause errors or unexpected behavior.
Incorrect Options:
A. bash:
Simply writing “bash” on the first line doesn’t instruct the OS to use it as the interpreter—it would be treated as a normal command.
B. !execute:
This is not a valid directive in Linux scripting; it has no function or meaning.
D. @echo off:
This command is used in Windows batch scripts, not in Linux shell scripts, and has no relevance in a Bash environment.
Reference:
CompTIA Server+ SK0-005 Exam Objectives – Domain 4.2: Given a scenario, use scripting tools and techniques.
The use of the shebang (#!) is a core Linux scripting practice that defines how a script is executed and ensures compatibility and predictable behavior across Unix-like systems.
Which of the following tools will analyze network logs in real time to report on suspicious log events?
A. Syslog
B. DLP
C. SIEM
D. HIPS
Explanation
The tool that is specifically designed to analyze network logs in real time and report on suspicious log events is a Security Information and Event Management (SIEM) system.
SIEM (C):
A SIEM system collects, aggregates, and correlates log data (events) from various sources across the network (servers, firewalls, applications, etc.). Its primary function is to perform real-time analysis to detect and alert on security incidents, anomalies, and suspicious activity.
Syslog (A):
Syslog is a protocol used to send log messages over an IP network. It's the source or transport mechanism for the logs, not the analysis tool that performs real-time correlation and reporting of suspicious events.
DLP (B):
Data Loss Prevention is a set of tools and processes designed to ensure that sensitive data is not lost, misused, or accessed by unauthorized users. While it generates logs, its primary role is not log analysis but rather preventing data exfiltration.
HIPS (D):
Host-based Intrusion Prevention System is software that runs on individual servers or workstations. It monitors the internal activity of that host (system files, registry, etc.) and actively blocks malicious actions. It is a defense tool on a single host, not a centralized, real-time log analysis and correlation tool for the entire network.
Reference
This question falls under the Server Security domain of the CompTIA Server+ (SK0-005) exam, specifically the tools used for security monitoring and incident response:
Domain 2.0:
Server Security (Understanding security controls and technologies).
Key Concept:
SIEM is the essential centralized platform for comprehensive security visibility and proactive threat detection through log correlation.
A systems administrator is investigating a server with a RAID array that will not boot into the OS. The administrator notices all the hard drives are reporting to be offline. The administrator checks the RAID controller and verifies the configuration is correct. The administrator then replaces one of the drives with a known-good drive, but it appears to be unavailable as well. Next, the administrator takes a drive out of the server and places it in a spare server, and the drive is available and functional. Which of the following is MOST likely causing the issue?
A. The kernel is corrupt.
B. Resources are misallocated.
C. The backplane has failed.
D. The drives need to be reseated.
Explanation
Let’s break down the key diagnostic evidence step by step:
All drives in the array show as offline → Not a single drive failure.
RAID controller configuration is verified correct → Rules out misconfiguration.
Replacing a drive with a known-good one → still shows unavailable → The new drive is also not detected.
Same drive works perfectly in a spare server → The drive itself is healthy; the problem is local to the original server.
This isolates the fault to a common component between the RAID controller and all disk slots — the backplane (the board that connects drives to power and data).
Why the other options are incorrect:
A. The kernel is corrupt.
The server doesn’t boot into the OS, but the RAID controller/BIOS can’t see any drives at all — this is a pre-OS hardware detection issue, not a kernel problem.
B. Resources are misallocated.
Resource issues (IRQ, memory, I/O ports) might cause boot hangs or device conflicts, but not every drive appearing offline in the RAID utility. Also, a known-good drive fails similarly.
D. The drives need to be reseated.
Reseating might fix one loose drive, but all drives failing — and a brand-new known-good drive also failing — makes poor connection across all bays unlikely. The spare server test proves the drives and cables are fine.
C. The backplane has failed. (Correct)
The backplane is the shared pathway for power and SAS/SATA signaling to all drives.
A failed backplane can:
Drop all drive detection.
Make any inserted drive (even known-good) appear offline.
Still allow the RAID controller to power on and show config.
The spare server test confirms the drives work elsewhere → backplane is the single point of failure.
Reference:
CompTIA Server+ SK0-005 Official Study Guide
Chapter 2: Storage Technologies → RAID Hardware Troubleshooting
“If all drives are offline and a known-good replacement drive also fails, suspect the backplane, midplane, or SAS expander.”
CompTIA Server+ Exam Objectives (SK0-005)
2.1 Given a scenario, install and maintain storage hardware.
“Identify failed components: … backplane, cabling, drive sleds.”
4.2 Given a scenario, troubleshoot common hardware failures.
“No drives detected in RAID array → check backplane power/data connectivity.”
Which of the following will correctly map a script to a home directory for a user based on username?
A. \\server\users$\username
B. \\server\%username%
C. \\server\FirstInitialLastName
D. \\server\$username$
Explanation
This question is about using an environment variable to dynamically map a path based on the logged-in user's username.
In Windows environments, %username% is a system environment variable that automatically expands to the name of the currently logged-in user.
When you use \\server\%username% in a logon script or a home directory mapping, the system replaces %username% with the actual username of the person logging in.
For example, if user "jsmith" logs in, \\server\%username% will automatically resolve to \\server\jsmith. This provides a single, standardized mapping that works uniquely for every user.
Why the other options are incorrect:
A. \server\users$\username:
This uses the literal string "username". It would try to map every user to the exact same folder named "username" instead of to a unique folder named after them.
C. \server\FirstInitialLastName:
This is a static path and requires manually creating a specific naming convention for each user. It will not automatically adapt to the logged-in user's name.
D. \server$username$:
The $username$ syntax is not a standard environment variable in Windows for this purpose. The correct variable is %username%.
Reference
This falls under CompTIA Server+ Domain 4.0: Server Administration, which includes user management and configuring logon scripts. The use of environment variables like %username% and %homedrive% is a standard practice in Windows server environments for automating user-specific configurations.
A server administrator is swapping out the GPU card inside a server. Which of the following actions should the administrator take FIRST?
A. Inspect the GPU that is being installed.
B. Ensure the GPU meets HCL guidelines.
C. Shut down the server.
D. Disconnect the power from the rack.
Explanation:
Before performing any hardware replacement or internal maintenance, the first and most critical step is to properly shut down the server. This ensures that all processes and data are safely stopped and prevents potential electrical damage or data corruption. Swapping out a GPU (or any internal component) while the server is still running can cause severe hardware damage, short circuits, or system instability.
Once the server has been safely powered down, the administrator can then proceed with other essential precautions such as disconnecting the power supply, grounding themselves to avoid electrostatic discharge (ESD), and verifying hardware compatibility before installation.
Why Not the Other Options:
A. Inspect the GPU that is being installed:
Inspection is important but should only occur after the server has been safely powered down. Doing this first could risk damaging active components.
B. Ensure the GPU meets HCL guidelines:
Verifying compatibility with the Hardware Compatibility List (HCL) is part of the planning stage, but not the first step in the replacement process itself.
D. Disconnect the power from the rack:
Power should indeed be disconnected, but only after shutting down the server through the operating system to avoid abrupt shutdowns that could lead to data loss or corruption.
Reference:
CompTIA Server+ SK0-005 Exam Objectives – Domain 2.1:
Install and Configure Server Hardware and Storage Technologies.
The objectives emphasize following proper shutdown and safety procedures before performing hardware maintenance or upgrades to prevent damage to components and ensure data integrity.
A technician runs top on a dual-core server and notes the following conditions:
top –- 14:32:27, 364 days, 14 usersload average 60.5 12.4 13.6
Which of the following actions should the administrator take?
A. Schedule a mandatory reboot of the server
B. Wait for the load average to come back down on its own
C. Identify the runaway process or processes
D. Request that users log off the server
Explanation
The key indicator in the top output is the load average:
60.5 12.4 13.6.
The load average represents the average number of processes that are either running or waiting to run (in the run queue) over the last 1 minute, 5 minutes, and 15 minutes, respectively.
Analyze the Load:
A load average of 60.5 on a dual-core server is extremely high. A simple rule of thumb for acceptable load is that the load average should be roughly equal to the number of CPU cores.
2 cores (Dual-core) = Acceptable load of $\approx 2.0$.
A load of $60.5$ means that, on average over the last minute, approximately $60$ processes are fighting for the $2$ available CPU cores. This indicates a state of severe resource saturation and a problem that won't simply fix itself.
Determine the Action (C):
The immediate and necessary action is to use tools like top, htop, or ps to identify the specific process or processes that are consuming excessive CPU time or are stuck in an unkillable state, causing the high load. Once identified, the process can be analyzed, debugged, or terminated (kill) to bring the load back to normal.
Schedule a mandatory reboot (A):
While a reboot might temporarily fix the issue, it is a drastic measure that interrupts service and does not address the root cause, which could cause the issue to return quickly.
Wait for the load average to come back down (B):
Given the extremely high load of $60.5$ on a 2-core machine, waiting is not an option. The server is likely nearly unresponsive and requires immediate intervention.
Request that users log off (D):
While user processes contribute to load, a single process or small set of processes with a bug (runaway process) is a much more common cause of such a massive load spike than normal user activity. Removing users might help slightly but doesn't fix the core problem.
Reference
This question relates to the Server Administration and Operating Systems domain of the CompTIA Server+ (SK0-005) exam, specifically the monitoring and troubleshooting of server performance:
Domain 1.0: Server Administration (Monitoring performance metrics like CPU utilization and load).
Key Concept:
Understanding the load average is critical for Linux server management. A load average significantly higher than the number of CPU cores ($N$) is an alert condition, requiring action to find and resolve the resource-hungry (runaway) process.
A server administrator added a new drive to a server. However, the drive is not showing up as available. Which of the following does the administrator need to do to make the drive available?
A. Partition the drive.
B. Create a new disk quota.
C. Configure the drive as dynamic.
D. Set the compression.
Explanation
A new raw hard drive (whether HDD or SSD) has no partition table or file system when first installed.
The operating system (Windows or Linux) will detect the disk but show it as “unallocated” or “not initialized” in Disk Management or fdisk/lsblk.
To make the drive available for use, the administrator must:
Initialize the disk (choose GPT or MBR).
Create a partition (e.g., primary partition).
Format the partition with a file system (NTFS, ext4, etc.).
Assign a drive letter or mount point.
Until partitioning is done, the drive cannot store data and will not appear as usable space.
Why the other options are incorrect:
B. Create a new disk quota.
Quotas control user storage limits on existing formatted volumes — they do nothing if the drive has no partitions or file system.
C. Configure the drive as dynamic.
Dynamic disks (Windows) enable advanced features like spanning or RAID — but only after the disk is initialized and partitioned as basic. You can’t convert a raw disk directly to dynamic.
D. Set the compression.
Compression is a file system feature (e.g., NTFS compression) applied after formatting — not possible on an unpartitioned drive.
A. Partition the drive. (Correct)
This is the first required step to make a new drive usable.
Reference:
CompTIA Server+ SK0-005 Official Study Guide
Chapter 2: Storage → Disk Initialization and Partitioning
“A new drive must be initialized, partitioned, and formatted before it can be used by the OS.”
CompTIA Server+ Exam Objectives (SK0-005)
2.2 Given a scenario, configure storage for a server.
“Create and format partitions on physical or virtual disks.”
“Initialize disk (GPT/MBR), create partition, format with file system.”
Microsoft Docs
– Initialize new disk
“To use a disk, you must first partition and format it.”
A server is performing slowly, and users are reporting issues connecting to the application
on that server. Upon investigation, the server administrator notices several
unauthorizedservices running on that server that are successfully communicating to an
external site. Which of the following are MOST likely causing the issue?
(Choose two.)
A. Adware is installed on the users’ devices
B. The firewall rule for the server is misconfigured
C. The server is infected with a virus
D. Intrusion detection is enabled on the network
E. Unnecessary services are disabled on the server
F. SELinux is enabled on the server
C. The server is infected with a virus
Explanation
Let's break down the scenario point by point:
The Problem:
The server is performing slowly, and users have connection issues.
The Critical Finding:
There are several unauthorized services running on the server.
The Consequence of the Finding:
These unauthorized services are successfully communicating to an external site.
This combination of symptoms—unauthorized services consuming resources (causing slowness) and establishing outbound connections (data exfiltration or "phoning home")—is a classic indicator of a malware infection.
C. The server is infected with a virus:
This is the primary cause. Malware, such as a virus, worm, or bot, often installs and runs unauthorized services or processes. These processes consume CPU, memory, and network bandwidth, leading to the observed performance and connection issues. The communication with an external site is a hallmark of malware behavior for receiving commands or exfiltrating data.
B. The firewall rule for the server is misconfigured:
While the malware is the root cause, the fact that it can "successfully communicat[e] to an external site" indicates a security control failure. A properly configured firewall should block unauthorized outbound traffic from a server. A misconfigured firewall rule (either too permissive or one that was maliciously added by the malware) is the most likely reason this communication is possible.
Why the other options are incorrect:
A. Adware is installed on the users’ devices:
The symptoms are directly tied to the server. Unauthorized services are running on that server, not on user devices.
D. Intrusion detection is enabled on the network:
Intrusion Detection Systems (IDS) are a security measure that monitors and alerts on suspicious activity. They do not cause performance issues or allow unauthorized services to run; they are designed to detect them.
E. Unnecessary services are disabled on the server:
This is a security best practice (hardening) and would prevent this type of issue, not cause it. The problem is that unauthorized services are enabled.
F. SELinux is enabled on the server:
SELinux (Security-Enhanced Linux) is a mandatory access control system that restricts what services and processes can do. If it were properly configured and enabled, it would likely have blocked the unauthorized services from installing or running, making it an unlikely cause.
Reference
This scenario is a core security troubleshooting issue covered under CompTIA Server+ Domain 2.0: Security. It combines concepts of:
Malware Detection:
Identifying symptoms of an infection (unauthorized processes, performance degradation, unexpected network traffic).
Security Controls:
Understanding the role of firewalls in preventing unauthorized network communication and how their misconfiguration can exacerbate a security breach.
A server administrator is experiencing difficulty configuring MySQL on a Linux server. The
administrator issues the getenforce command and receives the following output:
># Enforcing
Which of the following commands should the administrator issue to configure MySQL
successfully?
A. setenforce 0
B. setenforce permissive
C. setenforce 1
D. setenforce disabled
Explanation:
The getenforce command displays the current mode of SELinux (Security-Enhanced Linux). The output Enforcing means SELinux is actively enforcing its security policies, which can sometimes prevent services like MySQL from running or being configured correctly if permissions or contexts are not set properly.
To temporarily allow configuration changes and reduce SELinux restrictions, the administrator can switch SELinux to permissive mode using the command:
setenforce 0
This command sets SELinux to permissive mode for the current session, meaning policy violations are logged but not enforced. This mode allows MySQL configuration to proceed without being blocked by SELinux policy rules. Once configuration is complete, the administrator can revert SELinux to enforcing mode using:
setenforce 1
Why Not the Other Options:
B. setenforce permissive:
This is not a valid syntax; the correct argument is numeric (0 for permissive, 1 for enforcing).
C. setenforce 1:
This sets SELinux to enforcing mode, which is already active and would continue blocking MySQL configuration.
D. setenforce disabled:
There is no such valid runtime option; SELinux can only be disabled permanently by editing the configuration file (/etc/selinux/config) and rebooting.
Reference:
CompTIA Server+ SK0-005 Exam Objectives – Domain 3.2:
Given a scenario, install and configure server operating systems.
SELinux configuration and troubleshooting are important when managing Linux-based servers, particularly for resolving permission and service configuration issues like those affecting MySQL.
A remote physical server is unable to communicate to the network through the available NICs, which were misconfigured. However, the server administrator is still able to configure theserver remotely. Which of the following connection types is the server administrator using to access the server?
A. Out-of-band management
B. Crash cart access
C. Virtual administrator console
D. Local KVM setup
E. RDP connection
Explanation
The key pieces of information in the scenario are:
The physical server's NICs are misconfigured and unable to communicate (meaning standard network protocols like TCP/IP are broken).
The server administrator is still able to configure the server remotely.
This combination points directly to Out-of-band management (OOB).
Out-of-band management (A):
This method uses a separate, dedicated network path and controller (like a Baseboard Management Controller/BMC or Integrated Lights-Out/iLO, Dell Remote Access Controller/DRAC, or Remote Management Module/RMM) that is independent of the server's main operating system and primary NICs. OOB allows the administrator to access the server's console, view boot processes, and change BIOS/NIC settings even when the main network connection is down or misconfigured.
RDP connection (E):
Remote Desktop Protocol (RDP) relies entirely on the server's operating system (OS) being booted and its primary network interface (NIC) functioning correctly with a valid IP address. Since the NICs are misconfigured, RDP is not possible.
Virtual administrator console (C):
This usually refers to the console accessible through a hypervisor (like VMware vSphere or Hyper-V Manager). While it allows remote access, the question refers to a physical server with misconfigured NICs, making the independent OOB channel a more precise and fundamental answer for this type of hardware-level failure.
Crash cart access (B) / Local KVM setup (D):
These terms describe local, physical access. A crash cart or a local KVM requires the administrator to be physically present in the data center, which contradicts the requirement to access the server remotely.
Reference
This question relates to the Server Hardware and Networking and Troubleshooting domains of the CompTIA Server+ (SK0-005) exam, specifically the methods for accessing and managing server hardware:
Domain 1.0:
Server Administration (Understanding remote access technologies like OOB).
Key Concept:
Out-of-band management is a critical feature for server resilience, ensuring administrative access is maintained even during severe network configuration errors or operating system failures.
| Page 15 out of 50 Pages |
| SK0-005 Practice Test | Previous |