I spent some time searching the web in my frustration thinking that 2fa was impossible on this MacBook. I think it was a stackoverflow comment somewhere that said to try this...
It's a common hack, i.e. Salesforce does same for the security token, IIRC same with github.