Set a firmware password on your Mac
When you set a firmware password, users who don't have the password will only be able start up from the designated startup disk, and no other disk.
This feature requires a Mac with an Intel processor. For the equivalent level of security on a Mac with Apple silicon, simply turn on FileVault. If the Mac is managed by MDM (mobile device management), MDM administrators can also remotely lock the Mac.
How to turn on a firmware password
When the utilities window appears, click Utilities in the menu bar, then choose Startup Security Utility (or Firmware Password Utility).
Click Turn On Firmware Password.
Enter a firmware password, then click Set Password. Remember this password!
Close the utility, then choose Apple menu > Restart.
Your Mac only asks for the firmware password when attempting to start up from a storage device other than the one selected in Startup Disk settings, or when starting up from macOS Recovery. Enter the firmware password when you see the lock and password field at startup:
How to turn off a firmware password
Start up from macOS Recovery. During the startup process, you'll be prompted to enter the firmware password.
When the utilities window appears, click Utilities in the menu bar, then choose Startup Security Utility (or Firmware Password Utility).
Click Turn Off Firmware Password.
Enter the firmware password again when prompted.
Close the utility, then choose Apple menu > Restart.
If you've forgotten your firmware password
If you can't remember your firmware password, schedule an in-person service appointment with an Apple Store or Apple Authorised Service Provider. Bring your Mac to the appointment, as well as your original receipt or invoice as proof of purchase.