User Access Control, Explained

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

← 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 →

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

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.

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 User Access Control

Is a password plus a security question multi-factor authentication?
No, a password plus a security question is not multi-factor authentication, because both are something you know. Multi-factor means combining different kinds of proof: something you know, like a password; something you have, like a phone that receives a code; or something you are, like a fingerprint. A thief who learns one secret can often find the other, but getting both a password and a phone is far harder.
Why do systems store password hashes instead of passwords?
Storing a hash means a copied password file does not reveal anyone's password. A hash is a one-way function: the same input always gives the same fixed-length output, but unlike encryption it cannot be reversed with a key. At login, the system hashes what was typed and compares it with the stored hash. A site that can email your old password back to you is storing it.
What is a salt in password hashing?
A salt is a short random string, different for each user, mixed into the password before hashing. It makes every stored hash unique, so two people with the same password get different hashes, and attackers cannot reuse ready-made lists of hashes for popular passwords. The salt is stored next to the hash and is not secret. If two users had the same salt and password, their hashes would match.
What does the sudo command do on Linux and macOS?
The sudo command lets an authorized user, such as a member of an administrators group, run a single command with root, or administrator, power after typing their own password. Only that command runs as root, and the system records who ran it and when. This puts least privilege into daily practice, since working as root all day means any slip or trick runs with full power. Windows has a similar approval prompt called User Account Control.

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 →