Can't boot Mac OS after applying restoring from InstallESD.dmg
Any Apple account that purchased the OS should work, but be sure you enter your password plus pin tacked on the end. The installer wasn’t prepared for MFA or TFA so this is a bit of an edge case.

https://support.apple.com/en-us/HT204915

Search to the bottom for the part

Then type your password followed by the six-digit verification code directly into the password field.

But you don’t really state what you want to do, we don’t know your exact model and if you can just connect this to another Mac in target disk mode and run the installer on a new Mac to install to the old one. Hopefully you can go back to recovery and get the normal install path to work from recovery still.
I’ve had good luck installing the OS I want to an external drive and holding option to boot as well if you don’t want to install direct over target disk mode.