Sub topic 2
Two-factor authentication and trusted devices
This chapter explains how two-factor authentication protects your Apple Account and how trusted devices and trusted phone numbers take part when you sign in to a new Mac. It assumes you know what an Apple Account is (covered in the previous chapter) and that you can open System Settings on a Mac, iPhone or iPad.
What two-factor authentication does
Two-factor authentication (2FA) requires two separate proofs before a new device can use your Apple Account:
- Something you know: your Apple Account password.
- Something you have: a six-digit verification code sent to a device or phone number you already control.
A stolen password alone is not enough. An attacker would also need one of your trusted devices or your trusted phone number.
Apple requires 2FA for most accounts created in recent years, and it is on by default for them. Older accounts may use a different, now-retired method. If your account has 2FA on, you generally cannot turn it off again.
Trusted devices and trusted phone numbers
Two lists matter during sign-in.
| Item | What it is | How it is used |
|---|---|---|
| Trusted device | An iPhone, iPad, Mac or other Apple device where you are signed in with your Apple Account and have verified your identity | Receives an approval prompt and shows a verification code when someone signs in elsewhere |
| Trusted phone number | A number you have verified for your account | Receives a code by text message or phone call when no trusted device is available |
A device becomes trusted after you sign in to it and enter a verification code. Trusted devices must have a passcode or password set. Your new Mac becomes a trusted device once you finish signing in during Setup Assistant.
You should have at least one trusted phone number, and ideally two. A second number, such as a family member's, gives you a way back in if you lose your main phone.
What happens when you sign in on a new Mac
When you enter your Apple Account and password in Setup Assistant, this sequence runs.
In practice you see these steps:
- You enter your email address or phone number and password.
- A prompt appears on your other Apple devices. It says someone is trying to sign in and shows a map with an approximate location. The location is based on the network the Mac is using, so it can be a nearby city rather than your exact address.
- You tap Allow only if you started the sign-in. The device then shows a six-digit code.
- You type that code on the Mac.
If you have no trusted Apple device nearby, choose the option to get the code by text message or phone call instead. Standard carrier rates may apply.
The code is valid for a short time. If it expires, request a new one rather than retrying the old one.
Verification codes versus device passcodes
Two kinds of codes are easy to confuse.
- The verification code is six digits and proves that you control a trusted device or number. Apple generates it for each sign-in attempt.
- The device passcode is the code you set on an iPhone or iPad to unlock it. It is not sent anywhere.
Apple support will never ask you to read out a verification code. Anyone who asks for one, whether by phone, text or email, is trying to take over your account.
Staying signed in
After you verify a browser, you can choose to trust it so you are not asked for a code again for a while. Do not do this on shared or public computers. On your own Mac, the Apple Account sign-in lasts until you sign out, so you will not repeat the code on each restart.
You may still be asked to enter your Apple Account password occasionally. Typical triggers include:
- Changing your password.
- Restoring a device from a backup.
- Signing in on a new device.
- A security check by Apple after unusual activity.
Managing your trusted lists
You can review and change both lists after setup.
On a Mac with macOS Ventura or later:
- Open System Settings.
- Click your name at the top of the sidebar.
- Choose Sign-In & Security to see and edit your trusted phone numbers.
- Return to the Apple Account pane. Scroll the list of devices to see every device signed in to your account.
The exact layout changes between macOS versions, so if an item has moved, use the search field at the top of System Settings.
To remove a device you no longer own, select it in the device list and choose Remove from Account. Do this when you sell, give away or lose a Mac. A removed device no longer receives verification codes.
You can also manage the account on the web at account.apple.com, which is useful when you cannot reach a Mac or iPhone.
Checking which Mac you are signing in from
Your device list contains one entry for every Mac. If you own several, entries can look similar. Before you remove an entry, compare its model and serial number against the Mac in front of you. This command prints the hardware details:
system_profiler SPHardwareDataTypeLook for the Model Name, Chip and Serial Number lines in the output, and match them against the entry in your device list. The serial number is the most reliable way to tell two similar Macs apart.
Common errors and what they mean
| Symptom | Likely cause | What to do |
|---|---|---|
| No prompt appears on your iPhone | Device is offline, in Low Power Mode, or signed in to a different Apple Account | Check the connection and the account name in Settings, or request a text message code |
| Code is rejected | Code expired, or you typed an older code | Request a new code and enter it promptly |
| No text message arrives | Wrong trusted number, poor reception, or carrier filtering | Check the number under Sign-In & Security, or use a trusted device |
| "Verification failed" or sign-in loops | Incorrect date and time on the Mac, or an unstable network | Connect to a stable network and confirm the Mac's date and time are set automatically |
| No trusted device and no access to your number | You have lost both factors | Use account recovery, covered in a later chapter |
Security habits worth keeping
- Keep a passcode on every Apple device that is trusted.
- Use a strong, unique password for your Apple Account that you do not use elsewhere.
- Keep the trusted phone number current when you change carriers or numbers.
- Check the device list now and then and remove devices you no longer own.
- Treat unexpected sign-in prompts as a warning that someone else has your password. Tap Don't Allow and change your password.
How this connects to setup
Two-factor authentication is the gate you pass through in the sign-in step of Setup Assistant. If you prepare your trusted device and phone number beforehand, the sign-in takes a minute. If you do not, a new Mac can stall at the verification screen. The next chapter covers what to prepare before you turn the Mac on.
Exercise
You are signing in to a new Mac during Setup Assistant. A sign-in alert appears on your iPhone, but you did not start any sign-in just now. What should you do, and why?
Show answer
Tap Don't Allow and do not read out or type any code. The alert means someone has entered your Apple Account password on another device. The password alone is not enough to get in, but you should change your password afterward and review your trusted devices and phone numbers. If you did start the sign-in on your new Mac, check that the location shown is plausible for your network, then tap Allow and type the code shown.
Exercise
Why is it a good idea to have two trusted phone numbers, and what command can help you tell two similar Macs apart in your device list?
Show answer
A second trusted number gives you another way to receive a code if your main phone is lost or broken, which prevents most lockouts. The command system_profiler SPHardwareDataType prints the model name, chip and serial number, and you can match the serial number against the entry in the device list.