IP Address Mismatch on signing into Heroku CLI

Copy and paste heroku login -i in your terminal. This is what solved it for me.


The accepted answer (run heroku login -i) doesn't work for accounts with MFA enabled. What I did instead was to reveal my account's API key and put it into ~/.netrc like so:

machine api.heroku.com
  login <MY_EMAIL>
  password <API_KEY>
machine git.heroku.com
  login <MY_EMAIL>
  password <API_KEY>

And voila! I can now use the CLI. This worked for me with Google CloudShell.

P.S. -- I added my machine's SSH key but could not understand how to use that to configure the CLI's access. It seems hard-coded to look for API keys in ~/.netrc.