UPI Study › Courses › Introduction to Operating Systems › Free lessons › Lesson 9.8 Free with a free account
User Access Control
Introduction to Operating Systems · Chapter 9: Computer Security and Threat PreventionSection 9.8 · lesson 76 of 839 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: Antivirus Software →← Operating System Security FeaturesNext lesson: Antivirus Software →
A free account plays all of Chapter 1 and 3 more lessons of Introduction to Operating Systems. Create a free account →
In this lesson
Authentication factors, salted password hashes, and least privilege in practice.
- Identify the three authentication factors and what makes authentication multi-factor
- Explain why systems store salted password hashes instead of passwords
- Explain why slow hash functions such as bcrypt, scrypt, and Argon2 suit passwords
- Describe how groups, sudo, and session timeouts control access
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,233 words). Read along, or search it.
Opening Puzzle
Checking a Password That Is Never Stored
At a school, the front office hands you a visitor badge. It gets you through the front door, but it doesn't open the staff room. Before any door opens, someone must answer two questions. Who are you? And what are you allowed to do? An operating system asks the same two questions. The first is called authentication. The second is called authorization. And here's a puzzle. Your computer checks your password at every login. Yet a well-built system never stores your password at all. How?
Authentication Factors
Something You Know, Have, or Are
Authentication means proving you are who you say you are. There are three kinds of proof, called factors. Something you know, like a password or a PIN. It can be guessed, or leaked. Something you have, like a phone that receives a code, or a key fob. It can be lost, or stolen. And something you are, like a fingerprint or a face. If it's ever copied, you can't change it. And a scanner can fail on a wet finger. Asking for two different factors is called multi-factor authentication. A thief would need both your password and your phone, which is far harder than either one.
Quick Check
Is a Pet Name a Second Factor
Quick check. A bank's login asks for your password. Then it asks a second question: the name of your first pet. Is that multi-factor authentication? Pause, and decide. No. Both are something you know. A thief who learned one secret can often find the other, so the second question adds little. Two factors means two different kinds, such as a password and a code sent to your phone.
Password Hashing
A One-Way Scramble Instead of a Password
Now the puzzle. If a system stored passwords, anyone who copied that file would learn every one: from a stolen laptop, a leaked backup, or a curious administrator. So well-built systems store a hash instead: the result of a one-way mixing function. A password goes in, and a fixed-length scramble comes out. The same input always gives the same output. But you can't run the scramble backward. Encryption, from lesson 7.5, can be undone with a key. A hash can't. To log in, the system hashes what you typed, and compares it with the stored hash. If they match, the password was right. And it was never saved.
Salting
A Unique Salt for Every User
There's a catch. If two people choose the same password, they get the same hash. And attackers keep ready-made lists of hashes for popular passwords. The fix is a salt: a short random string, different for every user, mixed into the password before hashing. The salt is stored right next to the hash. It isn't secret. Its job is to make every stored hash unique, so no list made in advance can be reused.
Code Walkthrough
Salted SHA-256 in Python
Here's the idea as a short Python script. It uses SHA-256, from Python's hashlib module. The function on line four puts the salt in front of the password, then hashes the result. Sam, who runs a small online bakery, and Dana, Sam's part-time baker, both chose the same password. But each gets a different salt. The salts are fixed here, so the output is the same on every run. Real salts are random. Lines fifteen to eighteen are two logins. Each attempt is hashed with Sam's salt, and compared with Sam's stored hash.
Program Output
Same Password, Different Hashes
Run it. Same password, yet the two hashes look nothing alike, because the salts differ. Only the first 32 of 64 hex characters are shown. The right password is accepted. With a capital B, it's refused. One letter changes the hash completely.
Quick Check
What If Two Salts Match
Quick check. Suppose Dana's salt were the same as Sam's, so line ten reads k3f9a1 twice. Run the script again. What would Dana's line print? Pause, and predict. Exactly Sam's hash. The same salt plus the same password makes the same input, and a hash always gives the same output. Python doesn't care whether salts repeat. Keeping them different is the system's job.
Code Proof
Matching Salts Give Matching Hashes
Here's the proof. Make Dana's salt match Sam's, and run it again. Now both lines print the same hash. With unique salts, cracking one person's password reveals nothing about anyone else's.
Slow Hashing
Why Password Hashes Should Be Slow
One honest warning. A single SHA-256 step, as in this teaching example, is very fast. And for passwords, speed is the wrong quality. Someone with a stolen file can try a huge number of guesses quickly. So real systems use deliberately slow password-hashing functions, such as bcrypt, scrypt, and Argon2. Each check costs real time and memory: unnoticed at one login, ruinous for mass guessing. Line twenty-one uses scrypt, from the same hashlib module. It's a different function, so its answer looks different again. And a common mistake: a site that can email you your old password is storing it. A well-built system can only reset it, because it never knew it.
Authorization
Groups, Root, and sudo
Once you're in, authorization decides what you may do. On Linux and macOS, it starts with the owner, group, and others switches from lesson 6.7. A group is a named set of users, so one rule can cover many people: everyone in bakery-staff may read the price list. Windows uses groups too. At the top is the all-powerful administrator account, called root on Linux and macOS. Working as root all day is dangerous: any slip, or any trick, runs with full power. So these systems offer sudo. A normal user puts sudo before one command, and types their own password. Just that command runs as root, and the system records who ran it, and when. Windows has a similar approval prompt, called User Account Control. It's least privilege, from lesson 9.5, in daily practice: power only for the moment it's needed.
Sessions
Screen Locks and Timeouts
A session is the stretch of time between logging in and logging out. During it, the system remembers who you are, so it doesn't ask at every click. That convenience is a risk. Walk away, and anyone who sits down is you. A screen lock hides the desktop, and asks for your password or fingerprint again. A session timeout does that by itself, after a set time with no activity. On shared or sensitive systems, it may end the session altogether. Banks and school portals use short timeouts for exactly this reason.
System Types
Single-User Versus Multi-User Needs
How much of this you need depends on how many people share a system. A single-user system, like a phone, serves one person at a time. The main risks are someone picking up the device, and malware. A screen lock, updates, and backups cover most of it. A multi-user system, like a school lab or a company server, serves many accounts at once. Its main risk is one user reading or breaking another's work. So it needs separate accounts, permissions, sudo, logs, and timeouts.
Story Ending
Three Accounts Replace One Sticky Note
Sam's shop laptop used to have one account that everyone shared, with its password on a sticky note. Ivy, who looks after the computers at a school, made three accounts: Sam as administrator, Dana as a standard user in the bakery-staff group, and a guest. She turned on a five-minute screen lock, and added a phone code to Sam's administrator login. Afterward, the order sheet showed exactly who had changed what.
Key Takeaways
Logins, Hashes, and Permissions Reviewed
To recap. Authentication proves who you are, with something you know, have, or are. Two different factors are far stronger than one. Systems store a salted hash, never the password itself, and use a slow hash function to make it. Groups and sudo give power only where, and when, it's needed. And screen locks and timeouts close the gap when you walk away.
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 User Access Control
Is a password plus a security question multi-factor authentication?
Why do systems store password hashes instead of passwords?
What is a salt in password hashing?
What does the sudo command do on Linux and macOS?
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 →