Sub topic 4
Choosing and safeguarding a recovery method
This chapter assumes you have turned on FileVault, or are about to, and have read the previous chapter on how it works. It also assumes you can use System Settings and run a basic Terminal command with sudo. You will compare the two recovery methods, pick one, and set up the storage and checks that make recovery work when you need it.
Why recovery needs a plan
FileVault encrypts your startup disk so that the data is unreadable without a key derived from a user password. That is the purpose of the feature, and it is also the risk. If you forget your password and have no other way in, nobody can get your data back. Apple cannot, and neither can a repair shop.
When you turn FileVault on, macOS asks you to choose a second way to unlock the disk. You have two options:
- Allow my iCloud account to unlock my disk. Your Apple Account becomes the recovery path.
- Create a recovery key and do not use my iCloud account. macOS generates a random code that you must store yourself.
Your choice decides who can recover your data and what you have to protect.
The two methods
iCloud account recovery
With this method, you reset your login password by proving that you control your Apple Account. At the login window, after several failed password attempts, macOS offers to reset the password using your Apple Account. After you sign in, you set a new password and the disk unlocks.
Strengths:
- You have nothing extra to store or lose.
- It fits how most people already manage their accounts.
Limits:
- Anyone who controls your Apple Account can use it to reach the disk. Your Apple Account password and two-factor authentication are now part of your disk's security.
- You need a network connection and working access to your Apple Account. That means access to a trusted device or phone number for verification codes.
- The Mac must be signed in to the same Apple Account that you chose when you enabled FileVault.
Personal recovery key
A recovery key is a random code of letters and numbers, shown in groups of four characters. macOS displays it once, when you turn FileVault on. You can enter it at the login window in place of your password.
Strengths:
- It does not depend on your Apple Account or on an internet connection.
- A compromised Apple Account cannot unlock the disk.
Limits:
- You are the only custodian. Apple does not keep a copy. If you lose both the key and your password, the data is gone.
- Anyone who finds the key and has the Mac can unlock it. Where you store the key is a security decision.
Side by side
| Question | iCloud account | Recovery key |
|---|---|---|
| Who can help you recover? | Your Apple Account, after verification | Only you, with the key |
| What do you have to store? | Nothing extra | The key, in a safe place |
| Needs internet to recover? | Yes | No |
| Main risk | Apple Account takeover or lockout | Losing or exposing the key |
| Best for | Most personal Macs | Disconnected setups, or people who do not want the Apple Account in the recovery path |
Deciding between them
Ask which failure you are more likely to suffer and which one you can better defend against.
Some practical guidance:
- If you use a strong Apple Account password with two-factor authentication, and you want the least maintenance, use iCloud recovery.
- If your threat model includes someone gaining access to your Apple Account, or you work offline, use a recovery key.
- You cannot see a recovery key again after setup. Treat the setup screen as your only chance to save it.
Turning on FileVault and choosing a method
- Open System Settings and select Privacy & Security.
- Scroll to FileVault and click Turn On.
- Authenticate with an administrator password if asked.
- Choose one of the two recovery options and click Continue.
- If you chose the recovery key, macOS shows it. Copy it somewhere safe before you click Continue.
- Restart if macOS asks you to. Encryption continues in the background after you log in.
You can use the Mac while encryption runs. Progress shows in the same settings pane, and fdesetup status reports it from Terminal.
fdesetup statusWhile encryption is running, the output reports that encryption is in progress and gives a percentage. When it finishes, the output says FileVault is On.
Safeguarding a recovery key
A recovery key is only useful if you can find it when your Mac cannot start. The rules below follow from that.
Where not to keep it
- Not on the encrypted disk. A file called
recovery-key.txton this Mac is unreachable in exactly the situation where you need it. - Not only in an app or service that needs this Mac to open. For example, a password manager that you can reach only from this Mac fails the same test.
- Not in a place that is easy for an attacker to find with the Mac. A sticky note on the laptop lid defeats the encryption.
Where to keep it
- A password manager that syncs to other devices, protected by its own strong master password and two-factor authentication.
- A printed copy in a locked drawer, a home safe, or a safe deposit box.
- A second copy in a different location, so that one fire or theft does not take both.
Two independent copies are the practical target. One copy is a single point of failure, and many copies in many places widen the chance that someone finds one.
Test that you can find it
Once a quarter, confirm that you can locate each copy without opening the Mac. You do not need to enter the key to test it. Check that you can read it and that the characters match what you saved.
Checking the state of recovery from Terminal
You cannot display an existing personal recovery key from Terminal. But you can confirm that one is set and which accounts can unlock the disk.
sudo fdesetup haspersonalrecoverykeyThis prints true if a personal recovery key is set on the Mac. It prints false if you chose iCloud recovery only.
sudo fdesetup listThis lists the users who can unlock the disk. Each line shows a username and a unique identifier.
Both commands are read-only. A script that runs the earlier status check along with the recovery check looks like this:
#!/bin/bash
# Summarise FileVault state and recovery setup.
echo "FileVault: $(fdesetup status)"
echo "Personal key set: $(sudo fdesetup haspersonalrecoverykey)"
echo "Users who can unlock:"
sudo fdesetup listRun it with bash. It asks for your password once for sudo.
Who can unlock the disk
FileVault unlocks per user. Only accounts that are enabled for FileVault can log in at the pre-boot unlock screen.
- The account that turned FileVault on is enabled automatically.
- Other local accounts must be enabled. In the FileVault pane, click Enable Users, or the equivalent button, and enter that user's password.
- A user you created after turning FileVault on may need to be enabled the same way.
If your only enabled user forgets their password and you chose a recovery key, the key is the only way back in. Having a second enabled administrator account with its own known password adds a recovery path. Keep that password as carefully as a recovery key. A second account with a weak password weakens the whole setup.
Changing your recovery method
You may want to switch methods, or replace a key that you think has been exposed.
- To move from iCloud to a recovery key, or the reverse, turn FileVault off and on again in System Settings and choose the new option. Turning it off decrypts the disk, and turning it on re-encrypts it. This takes time and the Mac stays usable while it runs.
- To generate a new personal recovery key without turning FileVault off,
sudo fdesetup changerecovery -personalcan do so. It asks for the credentials of a FileVault-enabled user and prints the new key. The old key stops working.
sudo fdesetup changerecovery -personalCopy the new key to your storage places immediately and remove the old copies. An old key that still sits in a drawer is a false sense of safety, because the next time you need it, it will not work.
Managed Macs
If an employer or school manages your Mac, FileVault may be configured by a device management system. These setups can escrow the recovery key to the organisation, or use an institutional recovery key. In that case:
- Your recovery path may be through the IT department, not iCloud or a personal key.
- Changing the FileVault settings yourself may be blocked or may violate policy.
- Ask your administrator how recovery works before you rely on your own plan.
Common mistakes
- Choosing a recovery key and never saving it. Fix: generate a new key with
fdesetup changerecovery -personalwhile you still know your password. - Choosing iCloud recovery with a weak Apple Account. Fix: set a strong password and turn on two-factor authentication, or switch to a recovery key.
- Storing the only copy of the key on the Mac. Fix: move it to a password manager that syncs and to a printed copy.
- Forgetting to enable other users. Fix: enable each account in the FileVault pane while you are logged in.
- Assuming
falsefromhaspersonalrecoverykeymeans no recovery. Fix: check the FileVault pane for the iCloud option.
Summary
FileVault gives you two ways back in. iCloud recovery is simple but ties the disk to your Apple Account. A recovery key is independent but depends on how you store it. Whichever you choose, keep recovery details outside the Mac, check them from time to time, and replace them if they may have been exposed. The next chapter turns to the other side of the Mac's defence, the firewall.
Exercise
You enabled FileVault with a recovery key two years ago and printed it. Today sudo fdesetup haspersonalrecoverykey prints true, but you cannot find the printout. Your Mac still starts normally. What should you do, and why now?
Show answer
Generate a new personal key with sudo fdesetup changerecovery -personal while you can still log in with your password. The old key stops working, so store the new one in two separate places off the Mac, such as a synced password manager and a locked printed copy. Do it now because after a forgotten password or a failed login, the missing key leaves no way to unlock the disk.
Exercise
A colleague says choosing iCloud recovery is always the safer option because Apple looks after it. Give one situation where a recovery key is the better choice, and say what you take on in exchange.
Show answer
If your Apple Account could be taken over, or you need recovery that works offline, a recovery key is better because the disk no longer depends on the account. In exchange, you become the only custodian of the key. Apple cannot recover it, so losing it along with your password means permanent data loss.