brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: fdesetup status tells you in one line whether FileVault is on

Security
~/tips/tip-macos-fdesetup-status

fdesetup status

Checks from Terminal whether FileVault disk encryption is on and a recovery key exists.

FileVault is the setting I’d want switched on for every Mac that leaves the house, and a MacBook leaves the house a lot. You can check it in System Settings under Privacy & Security, but from Terminal it’s quicker, and the status check doesn’t need sudo.

Run this:

fdesetup status

It answers with FileVault being On or Off. While the disk is still encrypting or decrypting, add -extended and on an APFS volume it keeps printing updates with an estimate of the time left.

The second thing I’d look at is the recovery key. If you forget your login password, that key is your way back in, so I’d want to know it exists:

sudo fdesetup haspersonalrecoverykey

That prints true or false. For a script there’s also fdesetup isactive, which returns exit status 0 together with the string true when FileVault is enabled, so something like this works in a check script:

if fdesetup isactive >/dev/null; then echo "FileVault on"; else echo "FileVault off"; fi

One catch: according to the man page, haspersonalrecoverykey also says false when an error happens or FileVault isn’t fully enabled yet. So a false right after you turned FileVault on doesn’t have to mean the key is missing. Run fdesetup status first, and only worry about the key once that says On.

Further reading: fdesetup man page, Manage FileVault in the Apple deployment guide

More Security tips tcpdump -nn -r capture.pcap port 53 mkcert -install Strict-Transport-Security: max-age=0 Referrer-Policy: strict-origin-when-cross-origin wp super-admin list All Security tips (79) All topics

Link