Skip to main content
Question

firmwarepasswd in a script


Forum|alt.badge.img+11

Good morning,

I wrote a short script to set the firmware password on our Mac OS 10.11 machines. Here's the line in question:

/usr/sbin/firmwarepasswd -setpasswd 1Password2Goes3Here -setmode command

It appeared to work when run, but now the Mac in question will not accept anything I give it as a password. I think I used the command incorrectly and I'm not sure what was actually set as a password. Any suggestions as to what I should try, based on the line above?

Thanks in advance!

4 replies

Forum|alt.badge.img+12
  • Contributor
  • 61 replies
  • April 27, 2016

have you looked at this page?

https://jamfnation.jamfsoftware.com/article.html?id=58


Forum|alt.badge.img+7
  • Contributor
  • 97 replies
  • April 27, 2016

If you did happen to set the password and can't find what it was, unfortunately you will have to call in GSX to get it unlocked. Provided you have proof of ownership of said device.


Forum|alt.badge.img+1
  • New Contributor
  • 2 replies
  • May 9, 2016

The same thing happened to me, luckily on a test unit. Seems like firmwarepasswd wants user input, rather than the password in a parameter. In my case the password was blank, as it sent a newline. I suggest you try booting the machine, running sudo firmwarepasswd -delete , authenticating and then hitting return at the firmware password prompt.

To script firmwarepasswd in a #!/bin/sh, here's what worked for me:

#!/bin/sh
/usr/bin/expect -c "spawn /usr/sbin/firmwarepasswd -setpasswd ; expect ":" ; send "1234\\n" ; expect ":" ; send "1234\\n" ; interact"

Forum|alt.badge.img+3
  • New Contributor
  • 8 replies
  • July 16, 2019

i tried this your script, from terminal efi password was configured succesefuly, but when i sent this script by MDM ( MobileIron) it has not been set .

!/bin/sh

/usr/bin/expect -c "spawn /usr/sbin/firmwarepasswd -setpasswd ; expect ":" ; send "1234 " ; expect ":" ; send "1234 " ; interact"


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings