X
Tech
Why you can trust ZDNET : ZDNET independently tests and researches products to bring you our best recommendations and advice. When you buy through our links, we may earn a commission. Our process

'ZDNET Recommends': What exactly does it mean?

ZDNET's recommendations are based on many hours of testing, research, and comparison shopping. We gather data from the best available sources, including vendor and retailer listings as well as other relevant and independent reviews sites. And we pore over customer reviews to find out what matters to real people who already own and use the products and services we’re assessing.

When you click through from our site to a retailer and buy a product or service, we may earn affiliate commissions. This helps support our work, but does not affect what we cover or how, and it does not affect the price you pay. Neither ZDNET nor the author are compensated for these independent reviews. Indeed, we follow strict guidelines that ensure our editorial content is never influenced by advertisers.

ZDNET's editorial team writes on behalf of you, our reader. Our goal is to deliver the most accurate information and the most knowledgeable advice possible in order to help you make smarter buying decisions on tech gear and a wide array of products and services. Our editors thoroughly review and fact-check every article to ensure that our content meets the highest standards. If we have made an error or published misleading information, we will correct or clarify the article. If you see inaccuracies in our content, please report the mistake via this form.

Close

I added a hardware security key to my MacBook, and it made my logins faster and safer

With the help of a hardware security key, you can configure your MacBook so that you can sign in with a PIN instead of having to type your password. Here's how I did it.
Written by Ed Bott, Senior Contributing Editor
MacBook Air and MacBook Pro on Energy Yellow background
Jason Hiner/ZDNET

For the past few months, I've been alternating my laptop usage between a Surface Pro 9 (running Windows 11) and an M2-powered MacBook Air. There's always a bit of an adjustment when switching between platforms, but I found one aspect of the MacBook especially frustrating: After a restart, I have to enter the local user account password before I can use the TouchID fingerprint recognition hardware. Can't MacOS work more like Windows Hello, which lets me sign on anytime using biometrics or a PIN?

Also: The best security keys: Expert tested and reviewed

Well, yes, it can! As long as you have the right hardware, that is.

Specifically, you need a USB security key that supports the Personal Identity Verification (PIV) standard and can act as a smart card for login purposes. As it turns out, anything in the YubiKey 5 series from Yubico meets these standards. Now, I just happen to have a few of these versatile keys hanging around, so I decided to make my MacBook a little easier to use, with their help.

Here's how I did it.

I started with a YubiKey 5 Nano, which is a remarkably small gizmo that plugs into one of the MacBook's two USB-C ports and sticks out just a tiny fraction of an inch. That's it on the far right in this family photo of the YubiKey 5 series.

yubikey-series-5

For any modern MacBook, you can use one of these Series 5 YubiKeys with a USB Type-C connector

Image credit: Yubico

I could have used a more traditional key that's designed to be plugged in and removed at the end of a session, but I was especially attracted to this device's capability to remain plugged in without my having to carry it separately.

The setup process is fairly straightforward and is documented in this Yubico support article, "Using Your YubiKey as a Smart Card in MacOS." For these instructions, I assume you're starting with a new hardware key that's never been previously configured.

How to set up your YubiKey on MacOS

Step 1: Download the YubiKey Manager app and install it on the Mac.

1. Download and install the app

 Download the YubiKey Manager app and install it on the Mac.

yubikey-manager-app

Click PIN Management to configure the hardware key before using the Setup for MacOS option

Screenshot by Ed Bott/ZDNET

2. Configure the hardware key

Open YubiKey Manager, click Applications > PIV, and click PIN Management. Make the following changes:

  • Set a new PIN. Click Change PIN and change the default value of 123456 to a value of your choosing, between 6 and 8 characters. Use numbers only, as MacOS does not support non-numeric characters for a PIN. This is the value you will type to unlock your Mac.
  • Set a new PIN Unlock Key (PUK). Click Change PUK and change the default value from 12345678 to one of your choosing, between 6 and 8 characters (numbers only). Keep a record of this code in a safe place. If the wrong PIN is entered three consecutive times, the PIN is blocked, and entering the PUK is the only way to unblock it. If you can't supply the correct PUK, or if you enter the wrong PUK three consecutive times, you'll need to reset the hardware key and start over.
  • Set a new Management Key. Click Change Management Key and then click Generate to change the 48-character triple-DES key to a new random value. You're not expected to remember this value, so also select the Protect with PIN checkbox here, and then click Finish.

3. Set up for MacOS

Open YubiKey Manager, click Applications > PIV, click Setup for MacOS, and then click Setup for MacOS. (Yes, that's a second button with the same label as the previous one.) 

This process pairs your hardware key with the certificates associated with the PIV application, turning your key into a MacOS-compatible smart card. Confirm that you want to overwrite the existing values, then enter your PIN and click OK.

4. Pair the hardware key with your MacOS user account

Remove the hardware key and reinsert it. MacOS will prompt you to associate the hardware key/smart card with your user account. Click that notification to begin the pairing process.

pair-yubikey-with-macos

Click the notification in the upper right corner to pair your hardware key with MacOS

Screenshot by Ed Bott/ZDNET

Pay close attention to the screens that follow. You'll need to enter the hardware key's PIN, followed by the password for your MacOS user account, followed by the password for your iCloud Keychain (which is probably the same as your account password).

And that's it. The next time you restart your MacBook, you can type your PIN instead of having to enter your password. That unlocks the TouchID fingerprint reader, which you can then use to sign in after you resume from sleep.

Also: I tried two passwordless password managers, and was seriously impressed by one

If the YubiKey isn't inserted when you restart (or resume from a long sleep session), you'll be prompted to enter your password. You can plug in the key to change that prompt and use your PIN instead.

In this configuration, you can safely change your password to be longer. (Experts say it should be at least 12 characters in length, but feel free to change it to a passphrase that contains upper- and lower-case letters and at least one number.) You'll still need to type that passphrase occasionally to make system-level changes, but you won't need it to sign in to your MacBook.

Editorial standards