Login with O365 using MFA but lost access to MFA phone and can't get it reset

Login with O365 using MFA but lost MFA phone and can’t get it reset.

I usually login to Gitlab using O365 and then connecting via MFA but i gave the phone i use for MFA and forgot to transfer it over to my new phone. This means i no longer have access to my Gitlab account and can’t do any script work which is important in my role.

Please can i get an urgent response as I’ve already raised it before but not had a response yet.

Kind regards,
Mohamed

Hi @mi95codes,
do you have an SSH key registered with your account?

You can use that to reset your recovery codes, following this guide.

Hi @rpadovani,

Thanks for your swift response. I think i have an SSH key but haven’t been able to use that guide to generate new codes.

The code editor i’m using is Gitbash and when i try to run ssh git@gitlab.example.com 2fa_recovery_codes with my O365 email address, i get the following error message:
“ssh: Could not resolve hostname gitlab.example.com: Name or service not known”

I’d really just like my MFA reset by an admin as i can’t seem to find a solution for this problem and need to update a script.

Thanks in advance.

Hi @mi95codes,

the instructions contain an example, not the actual command. So, if you are using gitlab.com, you need to type:

ssh git@gitlab.com 2fa_recovery_codes

please notice the url is @gitlab.com, not @gitlab.example.com

Hi @rpadovani,

Once again, thanks for the prompt response, hope you’re well and in good spirits.

I tried it with my O365 email address so it was in this format “firstname.lastname@myo365emailaddress.com

Would that be the wrong thing to do?

Kind regards
Mohamed

@mi95codes -

When authenticating via SSH you’re identified by your SSH key, not your username. So actually, for anyone to generate their 2FA recovery codes on GitLab.com they’d type exactly:

1 Like

Thanks @ikozloff,

I tried that too and this is what I got:

“Warning: Permanently added the ECDSA host key for IP address to the list of known hosts.
git@gitlab.com: Permission denied (publickey).”

This is telling you two things:

  1. You’ve probably never used SSH from this computer to connect to GitLab.com
  2. The SSH key that’s being used to connect to GitLab.com is not known; i.e. you didn’t register it when you had access to your account.

If you belong to a paid group on GitLab.com, you have access to support and can [raise a support ticket](https://support.gitlab.com] to go through some account verification procedures. It may be possible to recover the account.

If you’re a Free user, you have a few more days before Support will no longer be processing MFA resets… so get your request in now :slight_smile:

Thanks for the information.

I’ll see what i can do.

1 Like