Skip to content

Instantly share code, notes, and snippets.

@AndrewWCarson
Created June 25, 2019 20:48
Show Gist options
  • Save AndrewWCarson/30ee08ba27d903dab29d7281ed53c231 to your computer and use it in GitHub Desktop.
Save AndrewWCarson/30ee08ba27d903dab29d7281ed53c231 to your computer and use it in GitHub Desktop.
This wraps the `fdesetup validaterecovery -inputplist` for easy remote execution. Edit the fvKey variable in the script with your key or run it with the key as an argument.
#!/bin/bash
fvKey="CN72-EJBE-8LTH-EL99-RDN5-OMXB"
if [[ $1 != '' ]]; then
fvKey="$1"; fi
sudo fdesetup validaterecovery -inputplist <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Password</key>
<string>$fvKey</string>
</dict>
</plist>
EOF
@AndrewWCarson
Copy link
Author

So... just, y'know, be careful where your keys are plaintext and stuff. #security #myrealkeyisatesla.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment