Server hardening is the practice of reducing security vulnerabilities by configuring a server to be as secure as possible. This concept is crucial for the SK0-005 exam because you must understand how to minimise attack surfaces and enforce secure communications to protect data and services. Hardening transforms a default, often vulnerable server into a resilient, production-ready system.
Jump to a section
A simple way to picture Server Hardening and Secure Configuration
A museum houses irreplaceable artefacts in a vast building with many rooms, corridors, and doors. To protect the collection, security staff conduct a thorough hardening process. First, they identify every door and corridor; many lead to storage rooms or staff areas that are not needed for public access. They permanently seal those unused entrances, just as a server administrator disables unnecessary services like Telnet or FTP that are not required for the server's function. Next, they replace simple locks on essential doors with high-security electronic locks that require encrypted keycards, analogous to replacing insecure protocols (HTTP, Telnet) with secure versions (HTTPS, SSH). They also change all default keycard codes, similar to changing default passwords. Finally, they install motion sensors and cameras in each corridor, mirroring logging and monitoring. Every measure reduces the chance of a breach, exactly like server hardening shrinks the attack surface.
Server hardening means making a server less vulnerable to attack by systematically reducing its attack surface. The attack surface is the total number of ways an attacker can interact with the server — every open port, running service, active account, and enabled protocol is a potential entry point.
Why disable unnecessary services? Each service that runs on a server adds code, opens network ports, and listens for connections. A service like the print spooler might be essential for a print server but completely useless on a web server. Leaving it running is dangerous: if a vulnerability is discovered in that service, an attacker could exploit it to gain access. By disabling it, you eliminate that risk entirely. The principle is called “least functionality” — a server should only have the services it actually needs.
Examples of common services to disable include: Telnet (insecure remote access), FTP (insecure file transfer), NetBIOS over TCP/IP (old file sharing protocol), the print spooler (if no printer is connected), and the Remote Desktop service (if remote desktop is not used). On Windows, you can disable services via the Services console (services.msc) or using PowerShell (Set-Service). On Linux, you use systemctl (systemctl disable servicename). Remember, disabling a service prevents it from starting at boot; stopping a service only halts it until the next reboot.
Why use secure protocols? Protocols define how clients and servers communicate. Insecure protocols like Telnet and FTP send data in plain text, meaning any attacker on the network can read login credentials, files, and commands. Secure protocols encrypt the communication, protecting confidentiality and integrity. For remote shell access, replace Telnet with SSH (Secure Shell, port 22). For file transfer, replace FTP with SFTP (SSH File Transfer Protocol, also port 22) or FTPS (FTP over SSL/TLS). For web traffic, use HTTPS (HTTP over TLS, port 443) instead of plain HTTP (port 80). Encryption uses certificates and cryptographic keys to scramble data so only authorised parties can read it.
Another key technique is changing default credentials. Most server operating systems come with built-in accounts like Administrator (Windows) or root (Linux). Attackers know these default usernames and often try common passwords. Hardening requires renaming or disabling these accounts, and setting strong, unique passwords for all accounts. The principle of least privilege applies here: give each account only the permissions it needs, nothing more.
Patch management is also part of hardening. Vendors regularly release updates to fix security flaws. Applying these patches closes known vulnerabilities. Hardening is not a one-time task; it requires ongoing monitoring and updates.
Finally, logging and monitoring are essential. After hardening, you still need to watch for suspicious activity. Enable audit logs (e.g., Windows Event Log, syslog on Linux) and send them to a central log server. This helps detect if an attacker bypasses your hardening efforts.
In summary, server hardening is a layered approach: disable what you don’t need, encrypt what you do, secure accounts, patch often, and watch everything. On the SK0-005 exam, you’ll need to identify which services to disable and which protocols to use in given scenarios.
Inventory and assess current services
List all running services on the server. Determine which are essential for the server's role (e.g., a web server needs HTTP/HTTPS services, but not the print spooler).
Disable unnecessary services
For each non-essential service, set its startup type to 'Disabled' (Windows) or use systemctl disable (Linux). This prevents the service from starting after a reboot, permanently reducing the attack surface.
Enable and configure secure protocols
Replace insecure protocols with their secure counterparts: Telnet to SSH, FTP to SFTP, HTTP to HTTPS. Configure these protocols to use strong encryption (e.g., TLS 1.2 or higher) and disable older, weak versions.
Change default credentials and enforce least privilege
Rename or disable built-in accounts (Administrator/root). Create custom service accounts with minimal permissions needed for each application. Set strong, complex passwords.
Apply security patches and updates
Ensure the operating system and all installed applications are up to date with the latest security patches. Patch management closes known vulnerabilities and is a critical part of hardening.
Implement logging and monitoring
Enable auditing to log successful and failed login attempts, service changes, and other security events. Forward these logs to a centralised system for analysis to detect suspicious activity.
Imagine you’re a junior administrator at a company called DataVault. The company is deploying a new application server that will host a customer database. Your task is to harden it before it goes live.
You start with a fresh installation of Windows Server 2022. You choose the Server Core installation option because it has no graphical user interface, reducing the attack surface and resource usage. Next, you open the Services console. You see dozens of services running. You know the server only needs to run a database (SQL Server) and have remote management via SSH. You systematically disable:
Print Spooler (no printer is attached)
Windows Update (you’ll manage updates through a central WSUS server, not local)
Remote Desktop (you use SSH for remote management)
Internet Explorer Enhanced Security Configuration (no web browsing needed)
Netlogon (not a domain controller)
For each service, you set the startup type to “Disabled”, not just “Stopped”, so they never start again.
You then change the Administrator account password to a complex, 20-character passphrase. You also create a new local account with limited permissions for day-to-day monitoring, and disable the built-in Guest account.
Now you turn to protocols. The web interface for the database must use HTTPS. You install a TLS certificate from the company’s internal certificate authority. You configure the web server to only accept TLS 1.2 and 1.3, disabling older, insecure versions like SSL 3.0 and TLS 1.0. You also disable HTTP altogether (port 80).
For remote management, you install an SSH server (OpenSSH for Windows) and ensure Telnet is not installed. You configure SSH to allow only key-based authentication, not passwords.
You configure the Windows Firewall to allow inbound traffic only on port 443 (HTTPS) and port 22 (SSH), and block all other ports. You also enable logging to forward events to a central Security Information and Event Management (SIEM) system.
Finally, you run a vulnerability scanner (like Nessus) to verify no unnecessary ports are open and no weak protocols are enabled. The scan comes back clean.
This real-world process demonstrates the exact steps an IT professional follows. The SK0-005 exam expects you to know the why and how behind each action, and to apply them in scenario-based multiple-choice questions.
The SK0-005 objective 2.3 specifically asks you to “configure server hardening techniques such as disabling unnecessary services and using secure protocols.” The exam loves to test your ability to choose the correct service to disable in a given context, and to identify which protocol replaces an insecure one.
Here are the exact concepts they test:
Disabling unnecessary services: They’ll present a list of services (e.g., Print Spooler, Telnet, DHCP Client, Remote Desktop) and ask which one should be disabled on a server that performs a specific role (e.g., a web server). The correct answer is the service not required for that role. Watch out for services that sound important but aren’t — like the “Server” service (which enables file sharing) — might be needed on a domain controller but not on a web server.
Secure protocol replacement: Questions often give a scenario where a company is using Telnet for remote administration. They ask what you should use instead. Answer: SSH. Similarly, FTP should be replaced with SFTP or FTPS. HTTP with HTTPS. They also test port numbers: Telnet = 23, SSH = 22, HTTP = 80, HTTPS = 443.
Default accounts: They love to ask about the built-in Administrator and root accounts. A common question: “What should you do with the default Administrator account?” Answer: Rename it and/or disable it. Changing the password alone is not enough because the account’s SID is well-known.
Principle of least privilege: They may ask why you should use a custom service account instead of the default SYSTEM account. Answer: to limit the damage if that service is compromised.
Service state vs startup type: A trap question might say “You stop the Print Spooler service. Why is it still running after a reboot?” Answer: because stopping only affects the current session; you must disable the startup type to prevent it from starting automatically.
Patch management: Hardening includes patching. They may ask which is NOT a hardening technique — and give “ignoring updates” as a distractor.
Logging and monitoring: They might ask what to enable to detect unauthorised access attempts — answer: audit logging.
Common exam traps:
Confusing disabling with stopping a service.
Thinking that using a firewall alone is sufficient for hardening (it’s not — you still need to disable services).
Assuming default passwords are safe if the server is on an internal network.
Not recognising that some services (like DHCP Client) are essential even on a web server.
To memorise, create a quick chart of insecure vs secure protocols and their ports. Also remember that “https://” uses TLS, which is the successor to SSL.
Disabling unnecessary services reduces the attack surface and minimises vulnerabilities.
Secure protocols like SSH, HTTPS, and SFTP must replace insecure protocols like Telnet, HTTP, and FTP.
Default accounts (Administrator, root) should be renamed, disabled, or given strong, unique passwords.
The principle of least privilege applies to both user accounts and service accounts.
Hardening is an ongoing process that includes regular patching and monitoring, not a one-time setup.
Understanding the difference between stopping a service and disabling its startup type is crucial for exam questions.
These come up on the exam all the time. Here's how to tell them apart.
Telnet
Sends data in plain text, including passwords
Uses port 23
No encryption
SSH
Encrypts all traffic
Uses port 22
Supports key-based and password authentication
FTP
Transfers files in plain text
Uses port 21 (control) and dynamic data ports
No built-in encryption
SFTP
Encrypts file transfer over SSH
Uses port 22
Authenticates using SSH keys or passwords
HTTP
Transmits data unencrypted
Uses port 80
No certificate required
HTTPS
Encrypts data using TLS
Uses port 443
Requires a trusted certificate
Default Administrator Account
Well-known username to attackers
Often has full system privileges
Harder to track in logs because of common name
Custom Service Account
Unknown username makes brute-force harder
Can be granted only required permissions
Easier to audit and monitor activity
Disabling a Service (Startup Type)
Prevents service from starting at boot
Requires administrator privileges to change
Permanent until changed back
Stopping a Service
Only halts the current running instance
Service will start again after reboot if startup type is Automatic
Temporary fix; does not eliminate the service as an attack surface
Mistake
Disabling unnecessary services will slow down the server.
Correct
Disabling unnecessary services typically improves performance by freeing system resources and reduces security risks. It does not slow the server down.
Beginners often associate ‘more services’ with ‘more functionality’ and mistakenly think disabling them harms performance. In reality, fewer processes mean less CPU, memory, and network overhead.
Mistake
Using HTTPS guarantees the server is completely secure.
Correct
HTTPS only encrypts data in transit between client and server. It does not protect against vulnerabilities in the server’s software, weak passwords, or misconfigured permissions. Hardening requires many layers beyond HTTPS.
The lock icon in browsers gives a false sense of total security. Beginners may believe encryption solves all security problems, ignoring other attack vectors.
Mistake
Firewalls alone are enough to secure a server.
Correct
Firewalls block network traffic but cannot stop attacks on services that are allowed through. Disabling unnecessary services and using secure protocols is essential even if a firewall is in place.
Firewalls are often the first security measure taught, so beginners may overestimate their effectiveness and neglect service hardening.
Mistake
Default passwords are acceptable on internal servers because attackers can’t reach them from the internet.
Correct
Internal networks still have threats (disgruntled employees, malware, lateral movement). Default passwords are well-known and trivial to exploit, regardless of network location.
Beginners assume security is only about external threats, forgetting that many breaches originate inside the organisation.
Reveal each answer, then mark whether you got it right. Score 60%+ to unlock the next chapter.
Server hardening is the process of securing a server by reducing its attack surface through techniques like disabling unnecessary services, using secure protocols, changing default passwords, and applying patches.
Each running service is a potential entry point for attackers. Disabling services that are not needed eliminates those vulnerabilities, making the server harder to compromise.
SSH encrypts all traffic (including passwords) between client and server, while Telnet sends everything in plain text. SSH is secure; Telnet is not and should never be used.
Open the Services console (services.msc), find the service, right-click, select Properties, and set Startup type to Disabled. You can also use PowerShell: Set-Service -Name ServiceName -StartupType Disabled.
SSH uses port 22, HTTPS uses port 443, SFTP uses port 22 (over SSH), FTPS uses port 990 for implicit FTPS or port 21 for explicit FTPS. Memorise these for the exam.
Yes, a firewall is a hardening tool, but it is not sufficient alone. You must also disable unnecessary services, use secure protocols, and apply other techniques to fully harden a server.
You've finished Server Hardening and Secure Configuration. Continue through the SK0-005 study guide to build a complete picture of the exam.
Done with this chapter?