Unlocking FileVault over SSH on a Headless Mac mini After a Restart

My Mac mini has no display, and I use it remotely through Screen Sharing. But every time it restarts, it stops at the FileVault unlock screen and Screen Sharing can't connect. Starting with macOS 26, you can do that step over SSH: connect, enter your login password, and the Mac carries on booting by itself.

Hi, I’m WindMori.

I have an M1 Mac mini with no display attached. It sits in a storage room and runs around the clock, and I manage it remotely with the Screen Sharing and SSH built into macOS. While it’s running, everything works fine. But whenever it restarts, I run into a really annoying problem:

After a restart, the Mac mini sits at the login screen, and Screen Sharing can’t connect.

It turns out that on macOS 26 Tahoe, you can unlock FileVault directly over SSH and let the Mac finish booting. After that, Screen Sharing connects again. The whole process is much simpler than I expected.

Why Screen Sharing can’t connect after a restart

A Mac with FileVault turned on doesn’t boot straight into macOS after a restart. It first waits at a pre-boot stage, and only after you enter your password and unlock the disk does macOS actually start:

Mac mini powers on
  ↓
Stops at the FileVault unlock stage
  ↓
macOS hasn't really started yet
  ↓
Screen Sharing can't connect

Screen Sharing is a macOS service, so it doesn’t run until the system has fully started. Until FileVault is unlocked, the Mac hasn’t really entered macOS at all. Even if the network is up, there’s no desktop to see.

Before, the only fix was to carry the Mac mini out, plug in a display and keyboard, type the password, and carry it back.

Prerequisite: turn on Remote Login

Starting with macOS 26 Tahoe, Macs with Apple silicon accept SSH connections even at the FileVault pre-boot stage. As long as Remote Login is turned on in advance, you can unlock the disk by entering your password over SSH.

On the Mac mini, turn on:

System Settings → General → Sharing → Remote Login

I’d also leave Screen Sharing on. The two split the work:

  • SSH: unlocking before boot, plus command-line management.
  • Screen Sharing: working in the graphical interface once macOS is up.

A wired connection is also a good idea. Early reports said the unlock only worked over Ethernet. Later versions seem to work over Wi-Fi too, but for a Mac mini you leave alone for months, a network cable is the safest bet.

Test SSH once first

I’ll use these example values below. Swap in your own:

Mac username: user
Mac mini IP:  192.168.1.50

In Terminal on another Mac, or in an SSH client on an iPad, enter:

ssh [email protected]

The first time you connect, you may see:

The authenticity of host '192.168.1.50' can't be established.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

That’s normal. SSH is asking whether you trust this computer you’re connecting to for the first time. Once you’ve confirmed the IP belongs to your Mac mini, type yes and press Return.

Next it asks for a password:

[email protected]'s password:

Enter your Mac login password. One thing to watch out for: when you type a password in SSH, Terminal shows nothing at all, not even *****. Just type it and press Return.

If you get logged in normally, Remote Login is ready to go.

After a restart: unlock over SSH

Where this really pays off is after the Mac mini restarts.

Say the Mac mini has restarted and Screen Sharing won’t connect. Run the same command again:

ssh [email protected]

If the Mac is waiting at the FileVault pre-boot stage, you’ll see this after entering your account password:

System successfully unlocked.
You may now use SSH to authenticate normally.
Connection closed by 192.168.1.50 port 22

If you see System successfully unlocked., the unlock worked.

Why it disconnects right away

That final Connection closed isn’t an error. It’s part of the normal flow. At this point the Mac mini is switching from the FileVault pre-boot environment to full macOS, so SSH drops for a moment:

Mac mini powers on, locked by FileVault
  ↓
Connect over SSH, enter login password
  ↓
System successfully unlocked
  ↓
SSH disconnects for a moment
  ↓
macOS starts up properly
  ↓
SSH and Screen Sharing work again

Give it a moment, and once the Mac has finished booting, run it again:

ssh [email protected]

This time you land in a normal shell:

user@Mac-mini ~ %

Screen Sharing should connect now, too.

So my routine has become:

Mac mini restarts
  ↓
Open a terminal on the iPad or Mac and SSH in
  ↓
Enter the password to unlock FileVault
  ↓
macOS finishes booting
  ↓
Carry on in Screen Sharing

Even with the Mac mini tucked away in the storage room, I no longer have to haul it out and plug in a display after every restart.

Tip: give the Mac mini a fixed IP

There’s one more setting that’s well worth doing: set up a DHCP reservation for the Mac mini on your router so its IP never changes.

Otherwise, one day after a router reboot, its address might move from 192.168.1.50 to 192.168.1.198, and you’ll have to hunt down the new IP before you can SSH in. And the moment the Mac is stuck waiting for its FileVault unlock is exactly when looking up its IP is hardest.

With a fixed IP, the same command always works. To make it even easier, give it a name in ~/.ssh/config:

Host macmini
    HostName 192.168.1.50
    User user

After that, all you need is:

ssh macmini

A common mix-up: HDMI dummy plugs

When it comes to Macs without a display, a lot of people think of an HDMI dummy plug (a virtual display adapter). It’s genuinely useful for a headless Mac. For example, it can:

  • keep a normal resolution in Screen Sharing
  • stop some remote desktop apps from showing a black screen
  • give the Mac a virtual display output

But it doesn’t solve the FileVault unlock problem. Until FileVault is unlocked, macOS itself hasn’t started, so it makes no difference whether there’s a “display” or not.

The two solve different problems:

  • HDMI dummy plug: solves “there’s no display.”
  • Remote unlock over SSH: solves “after a restart, I can’t get into the system.”

If your Mac mini also lives somewhere without a display, here’s the combination I’d recommend:

  • A wired network connection
  • A fixed IP set on the router
  • FileVault turned on
  • Remote Login (SSH) turned on
  • Screen Sharing turned on

Use Screen Sharing day to day. After a restart, first run ssh username@your-mac-mini-ip and enter your login password to unlock FileVault. Once macOS has finished booting, go back to Screen Sharing.

Final thoughts

Turning on FileVault on a Mac mini used to mean choosing between security and easy remote management. With SSH unlock, I finally don’t have to pick one.

A single Mac mini can now run as a proper headless Mac for the long haul, without keeping a display around just for the occasional restart.

References

  1. You can finally manage Macs with FileVault remotely in Tahoe (Jeff Geerling)
  2. Remote FileVault unlock in macOS Tahoe 26
Yours,WindMori