System Hardening, Explained

UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 9.6 Free with a free account

System Hardening

Introduction to Operating Systems · Chapter 9: Computer Security and Threat PreventionSection 9.6 · lesson 74 of 838 min · free with a free account

← Proactive Threat PreventionNext lesson: Operating System Security Features →

A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →

Earn 3 college credits for Introduction to Operating SystemsRecommended for credit by NCCRS · Computer Science 354 · self-paced · one payment, lifetime access

In this lesson

Shrinking a system's attack surface one closed door at a time.

  • Define system hardening and the attack surface
  • Identify unneeded services and default accounts to remove or disable
  • Restrict a secret file so only its owner can read it
  • Explain deny-by-default firewall rules

Free study notes

Get this lesson's notes by email

The key points and 4 practice questions with answers, in your inbox. One email, free.

One email. Unsubscribe in one click.

Transcript

Everything said in the video, section by section (1,067 words). Read along, or search it.

Opening Analogy

How Many Doors a House Needs

A new house comes with a front door, a back door, a garage door, a pet flap, and six windows. Most are fine. But which ones do you actually need? Every opening is one more place a burglar could try. A freshly installed computer is the same. It arrives with dozens of services running, a few default accounts ready, and settings chosen for convenience, not safety. Sam, who runs a small online bakery, has an old laptop serving the shop's website. How many doors does that laptop really need?

Definition

Hardening Shrinks the Attack Surface

To harden a system means to reduce the ways it can be attacked, by removing or locking down everything that isn't needed. All the places an attacker could try to get in are called the attack surface. The smaller it is, the fewer things you must watch and fix. Why does extra software matter? A program you never use still has flaws. And if it's running, others can reach it. Security people put it simply: every service you remove is one you never have to patch. One caution. Before you switch something off, find out what it does. Change one thing at a time, and check that everything still works.

Services

Is Each Background Service Needed

A service is a program that runs in the background, waiting for requests, like a web server or a file-sharing service. Lesson 1.9 showed the system starting them at boot. Hardening asks one plain question of each service: do we need this? If not, stop it, and tell the system not to start it again. On Linux, a tool such as systemctl does this. Windows has a Services window. And a Mac switches sharing features on and off in System Settings.

Worked Example

Six Open Doors, Two Needed

Here's Sam's laptop server, as an illustration. Six doors are open. The web server and remote login, which the shop needs. Plus file sharing, an old telnet login, a print server, and a demo database, which nobody uses. Only two are needed. The other four can be stopped and switched off, so nobody can reach them, or attack them.

Accounts

Default Passwords and Forgotten Logins

Accounts need the same review. Many systems arrive with default accounts or sample logins, sometimes with well-known default passwords. Disable the ones nobody uses. Change the passwords of the ones you keep. And remove an account the day its owner leaves. A forgotten account that nobody watches is exactly what a stranger hopes to find. The common mistake is leaving the factory password on a router or a camera, because it works. Those passwords are public knowledge. That's how the Mirai botnet from lesson 9.1 grew. It tried a list of sixty-two common default passwords. So change them first, before the device touches the network.

Quick Check

An Old Chat Server Nobody Uses

Quick check. A library's catalog computer also runs an old chat server that nobody has opened in years. Which change makes its attack surface smaller? Pause, and decide. Uninstalling the old chat server. A program that's gone can't be reached, and never needs another patch. A longer password is good, but it strengthens a door that's still there. And a second antivirus adds more software to the machine, so if anything, the surface grows.

File Permissions

From Readable by Everyone to Owner Only

Software often ships with its loosest settings, so installing is easy. A secure default flips that: start closed, and open only what's needed. The same idea works for files. Sam's shop configuration file holds a made-up database password. It starts out readable and writable by everyone. On a Mac, the stat command shows its permission letters: read and write, for the owner, the group, and everyone else. chmod go minus w takes write away from the group and others. Then chmod go minus r takes away read. Now it's r w, then nothing but dashes: owner only. That's the 600 setting from lesson 6.7. Sam can still read the file, and any other ordinary account is refused. The file itself didn't change at all. Only the list of who could reach it did.

Firewalls

Start from Deny Everything

At a school entrance, a guard checks who comes in. A firewall does the same for network traffic. It's a set of rules that decides which connections may reach a computer, and which may leave it. It can be software built into the system, or a separate box at the edge of a network. Good firewall rules follow least privilege. Start from deny everything. Then add a few allow rules, for what the system really offers. NIST's firewall guide recommends exactly that: traffic that isn't expressly permitted should be blocked. A firewall doesn't make a flawed program safe. It keeps most strangers from ever reaching the door. The name comes from buildings: a wall that stops a fire from spreading.

Quick Check

A Print Service Behind the Firewall

Quick check. Sam's firewall has three rules: allow web orders, allow remote login, and deny everything else. The old print service is still running, because nobody has switched it off yet. A stranger on the internet tries to connect to it. What happens to that connection? Pause, and decide. Dropped. The firewall checks its rules, finds none that allows printing, and the last rule denies everything else. A running service doesn't open the firewall by itself. That's the point of deny by default. But switch the print service off anyway. If the rules ever change, it's one less door.

Story Ending

Twenty Minutes to Two Doors

Ivy, who looks after the computers at a school, sat down with Sam's laptop server. She switched off the four services the shop never used, and deleted an old test account called demo. She set the config file to owner only. And she turned on the firewall, allowing only web orders and remote login. It took twenty minutes. Back to the opening question: the laptop needed two doors, and now two are all it has.

Checklist

A Repeatable Hardening Routine

Hardening isn't a mystery. It's a short checklist you walk through for every new system. Remove what's unused. Review the accounts. Update everything. Tighten the permissions. Turn on the firewall. And keep logs, and check them. Then repeat it now and then, because systems drift as people install things. And write down the hardened state, so months later you can see what changed.

Key Takeaways

Closing Doors Reviewed

To recap. Hardening shrinks the attack surface. Every unused service and account is a door to close. Change default passwords before a device touches the network. Lock secrets down to their owner, like the file that went from read and write for everyone, to owner only. And a firewall denies by default, allowing only what the system really offers.

About Introduction to Operating Systems at UPI Study

Introduction to Operating Systems (Computer Science 354) is a self-paced online course of 83 video lessons in 10 chapters, from what an operating system does and process scheduling to concurrency, memory, devices, file systems, networks, the internet, security and virtual machines. It carries a NCCRS credit recommendation for 3 semester credits.

Every lesson transcript is free on pages like this one, and the videos are free with a free UPI Study account. Enrolling adds a practice quiz after each lesson, the graded work and final exam that earn the credit, lifetime access, and an official transcript on completion. UPI Study has helped over 130,000 students with college credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Compare: Linux vs Operating Systems

Why take it here

Why students take Introduction to Operating Systems with UPI Study

What happens under every app you runIntroduction to Operating Systems explains the software that runs a computer: processes and scheduling, threads and synchronization, deadlock, memory and paging, devices and storage, file systems, networking, security and virtualization. It suits computer science and information technology degrees.
Credit at a fraction of the priceThe same 3 credits can cost $750 or more at a US college. Here it is one payment, self-paced, with lifetime access.
Finish your degree soonerTransfer credits reduce the courses you still owe, so you can graduate earlier or lighten a heavy semester.
Strengthen an applicationA completed college-level course on an official transcript shows admissions and scholarship committees you can do the work.
Study on your own scheduleNo start dates, no deadlines. Watch the lessons, practice, and take the final when you are ready.
130,000+students helped with college creditsACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Where the credit goes

Universities that work with NCCRS

Introduction to Operating Systems carries a NCCRS credit recommendation. These universities work with NCCRS; some are UPI Study's signed partners. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.

Find my college → Not listed? Ask Athena in the corner of this page, or book a 15-minute call.

FAQ

Questions students ask us

About System Hardening

What is system hardening?
System hardening means reducing the ways a computer can be attacked by removing or locking down everything it does not need. All the places an attacker could try to get in form the attack surface, and hardening shrinks it. Typical steps are removing unused services, reviewing accounts, updating software, tightening permissions, turning on the firewall, and keeping logs. Change one thing at a time and confirm everything still works.
Why should unused services be disabled on a server?
Unused services should be disabled because a running program can be reached by others and still has flaws, even if nobody uses it. Every service removed is one that never needs patching. On Linux, a tool such as systemctl stops a service and keeps it from starting at boot, while Windows uses its Services window. Find out what a service does before switching it off.
Why is it important to change default passwords on routers and cameras?
Default passwords are public knowledge, so a device left with its factory password is easy to take over. The Mirai botnet grew in 2016 by trying a list of sixty-two common default passwords on home routers, cameras, and video recorders. Change default passwords before a device touches the network, disable default accounts nobody uses, and remove any account on the day its owner leaves.
What does deny by default mean for firewall rules?
Deny by default means a firewall blocks all traffic unless a rule expressly allows it. Administrators start from deny everything, then add a few allow rules for what the system really offers, such as web orders and remote login. NIST's firewall guidance takes the same approach. A running service does not open the firewall by itself, but unused services should still be switched off in case the rules change.

About the Introduction to Operating Systems course

How many college credits is Introduction to Operating Systems?
Introduction to Operating Systems (Computer Science 354) carries a NCCRS credit recommendation for 3 semester credits. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities.
How much does Introduction to Operating Systems cost and what is included?
$250, paid once, with lifetime access: all 83 video lessons, a practice quiz after each, the graded work and final exam, and an official transcript when you finish. Students who want several courses choose UPI Study PRO instead.
Which universities accept UPI Study credits?
UPI Study has signed partner agreements with universities such as Thomas Edison State University, University of the People and Charter Oak State College, and works with universities such as Penn State, SNHU and SUNY. ACE and NCCRS have over 2,100 cooperating colleges that will consider accepting credits; the final decision is with the universities. Use "Find my college" on this page to check yours.
How long does Introduction to Operating Systems take?
It is self-paced with no deadlines. The 83 lessons total about 10 hours of video; most students add reading and practice time and finish in a few weeks to a few months, on their own schedule.
How are the exams done?
Quizzes and assignments are online in the course. The final exam is taken online with proctoring; a person on the UPI Study team checks assignments, usually within two days.
How do my credits reach my college?
When the course shows 100% complete, request the official transcript from your dashboard. It is sent to the college you name, and you can send it to more than one. Check your college first with "Find my college" on this page, or ask Athena.

Ready for the full course? Earn 3 credits in Introduction to Operating Systems.

83 video lessons, a quiz after each one, and the graded work that earns the credit. Recommended for credit by NCCRS.

Updated

Introduction to Operating Systems
3 credits · NCCRS
Enroll →