Create a FileVault master keychain

When prompted, enter the master password for the new keychain, then enter it again when prompted to retype. Terminal doesn't show the password as you type.

A key pair is generated, and a file named FileVaultMaster.keychain is saved to your desktop. Copy this file to a secure location, such an encrypted disk image on an external drive. This secure copy is the private recovery key that can unlock the startup disk of any Mac set up to use the FileVault master keychain. It is not for distribution.

In the next section, you will update the FileVaultMaster.keychain file that is still on your desktop. You can then deploy that keychain to Mac computers in your institution.

Remove the private key from the master keychain

In the Keychain Access sidebar, select FileVaultMaster. If you see more than two items listed on the right, select another keychain in the sidebar, then select FileVaultMaster again to refresh the list.

If the FileVaultMaster keychain is locked, click in the upper-left corner of Keychain Access, then enter the master password you created.

From the two items shown on the right, select the one identified as ”private key” in the Kind column:

Deploy the updated master keychain on each Mac

Put a copy of the updated FileVaultMaster.keychain file in the /Library/Keychains/ folder.

Open the Terminal app and enter both of the following commands. These commands make sure that the file's permissions are set to -rw-r--r-- and the file is owned by root and assigned to the group named wheel.

If FileVault is turned off, open Security & Privacy preferences and turn on FileVault. You should see a message that a recovery key has been set by your company, school, or institution. Click Continue.

Use the private key to unlock a user's startup disk

On the client Mac, start up from macOS Recovery by holding Command-R during startup.

If you don't know the name (such as Macintosh HD) and format of the startup disk, open Disk Utility from the macOS Utilities window, then check the information Disk Utility shows for that volume on the right. If you see ”CoreStorage Logical Volume Group” instead of ”APFS Volume” or ”Mac OS Extended,” the format is Mac OS Extended. You will need this information in a later step. Quit Disk Utility when done.

Connect the external drive that contains the private recovery key.

From the menu bar in macOS Recovery, choose Utilities > Terminal.

If you stored the private recovery key in an encrypted disk image, use the following command in Terminal to mount that image. Replace /path with the path to the disk image, including the .dmg filename extension:

hdiutil attach /path

Example for a disk image named PrivateKey.dmg on a volume named ThumbDrive:
hdiutil attach /Volumes/ThumbDrive/PrivateKey.dmg

Use the following command to unlock the FileVault master keychain. Replace /path with the path to FileVaultMaster.keychain on the external drive. In this step and all remaining steps, if the keychain is stored in an encrypted disk image, remember to include the name of that image in the path.

security unlock-keychain /path

Example for a volume named ThumbDrive:
security unlock-keychain /Volumes/ThumbDrive/FileVaultMaster.keychain

Enter the master password to unlock the startup disk. If the password is accepted, the command prompt returns.

Continue as described below, based on how the user's startup disk is formatted.

APFS

Enter the following command to unlock the encrypted startup disk. Replace "name" with the name of the startup volume, and replace /path with the path to FileVaultMaster.keychain on the external drive or disk image:

Mac OS Extended (HFS Plus)

Select the UUID that appears after “Logical Volume,” then copy it for use in a later step.Example: +-> Logical Volume 2F227AED-1398-42F8-804D-882199ABA66B

Use the following command to unlock the encrypted startup disk. Replace UUID with the UUID you copied in the previous step, and replace /path with the path to FileVaultMaster.keychain on the external drive or disk image: