Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Free lesson

Authentication: passwords and factors

After this lesson: I can compare ways to prove who you are and judge a password.

55 min lesson5 commandsLinux administration lab: users, permissions, cron and systemd in your browser

What is authentication?

Authentication is proving that you are the person or the program you say you are. A system that cannot tell users apart cannot protect anything from them.

You do it many times a day: a phone passcode, a card and a PIN, a code sent by text message. They are different ways to answer the same question.

By the end of this lesson

Note

I can compare ways to prove who you are and judge a password.

Key words

WordWhat it means
Authenticationproving who you are to a system
Factorone kind of proof of who you are
Multi-factor authenticationusing proofs of two or more different kinds
Brute forcetrying guess after guess until one works
Passphrasea long password made of random words
Accountthe identity a system gives to a user

The cells students fill in are left blank in this preview.

There are three kinds of proof

A factor is one kind of proof. There are three.

Something you know, such as a password. Something you have, such as a phone or a card. Something you are, such as a fingerprint.

Multi-factor authentication uses two or more different kinds. A thief who steals the password still has no phone.

Worked example: three factors compared

FactorExampleHow it fails
KnowA passwordIt is guessed, reused or told to a stranger
HaveA phone that receives a codeThe phone is lost or stolen
AreA fingerprintIt cannot be changed once copied
Know and haveA password and a codeThe thief needs both

The cells students fill in are left blank in this preview.

Longer passwords have far more guesses

A thief using brute force tries every possible password. The number of possibilities is the number of symbols to the power of the length.

Eight lowercase letters give 26 symbols to the power 8. Eight letters and digits, upper and lower, give 62 to the power 8. Five random words from a list of 2,000 give 2,000 to the power 5.

Eight lowercase letters

Command
echo $((26**8))

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Eight letters and digits

Command
echo $((62**8))

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Five random words from 2,000

Command
echo $((2000**5))

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Worked example: the number of guesses

Password typePossibilitiesRead as
8 lowercase letters208,827,064,576about 209 billion
8 letters and digits218,340,105,584,896about 218 trillion
5 random words32,000,000,000,000,000about 32 quadrillion

The cells students fill in are left blank in this preview.

A common mistake

Warning

Many people think a capital letter, a digit and a symbol make a strong password. P@ssw0rd1 follows those rules and is on every list of guesses, because everyone changes the same letters. Length and unpredictability protect you. Tricks do not.

Count the characters in four passwords

Command
printf 'password\n123456\nqwerty\nBlue-Harbour-Seven-Clock\n' | awk '{print length($0)}'

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

A system checks accounts, not people

A system never sees you. It sees an account, a name with a password and some rights. Anyone who proves they know the password is treated as that account.

So the most powerful accounts need the strongest proof. On Linux the root account has the user id 0, the number the system uses to decide who may do anything.

Which accounts have the user id 0?

Command
awk -F: '$3 == 0 {print $1}' /etc/passwd

Shown here, not run. Create a free account to press Run and type it into your own lab’s terminal.

Going further

Choose three of your own online accounts. For each, write which factors it asks for, and which one you would add.

Then say what happens to each account if your phone is lost. A good plan names a way back in before the phone goes missing.

About this lab and its source: Linux administration lab: users, permissions, cron and systemd in your browser

Teaching a class? Set this module for your students with a teacher guide, marked assignments and a lab for every student.