MacOS – Install OS X recovery mode. Can’t log in

apple-storeauthenticationinstallmacosrecovery

Dusting off an old iMac and it was hanging at 50% progress bar during start up. Since I don't need anything on it I'm trying to reformat.

I've booted into recovery mode and erased the drive. Then selected to install new OS. Chose the drive (it's also showing a locked recovery drive). By then it asks me to log into Apple Store. I do and it's saying wrong password. But then my phone asks for permission for login with my account. I approve and it still doesn't let me in on the iMac. Phone is giving an auth code but no where to enter it on iMac.

Best Answer

The version of the operating system of the recovery partition is probably lower than 10.11.0.

According to Apple you have to append the auth code to the password then:

What if I use two-factor authentication on a device running older software? If you use two-factor authentication with devices running older OS versions, you might be asked to add your six-digit verification code to the end of your password when signing in. Get your verification code from a trusted device running iOS 9 and later or OS X El Capitan and later, or have it sent to your trusted phone number. Then type your password followed by the six-digit verification code directly into the password field.