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
Free preview
Create a free account to keep watching
It takes a minute and costs nothing. Your free account unlocks all of Chapter 1 and 3 more lessons of Introduction to Operating Systems.
Lesson complete
Earn the 3 college credits for Introduction to Operating Systems
Enrolling adds a quiz after each lesson, the graded work and the official transcript. Recommended for credit by NCCRS.
Next lesson: Operating System Security Features →← 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 →
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.
Enroll now → Course details Download the syllabus All Computer Science courses Every course with PRO →
Compare: Linux vs Operating Systems
Why take it here
Why students take Introduction to Operating Systems with UPI Study
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.
Thomas Edison State UniversitySigned partner
University of the PeopleSigned partner
Charter Oak State CollegeSigned partner
Strayer UniversitySigned partner
Columbia Southern UniversitySigned partner
Indiana TechSigned partner
Penn StateWorks with NCCRS
Southern New Hampshire UniversityWorks with NCCRS
SUNYWorks with NCCRS
+many more cooperating universitiesFind my college →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?
Why should unused services be disabled on a server?
Why is it important to change default passwords on routers and cameras?
What does deny by default mean for firewall rules?
About the Introduction to Operating Systems course
How many college credits is Introduction to Operating Systems?
How much does Introduction to Operating Systems cost and what is included?
Which universities accept UPI Study credits?
How long does Introduction to Operating Systems take?
How are the exams done?
How do my credits reach my college?
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
3 credits · NCCRSEnroll →