How to recoverd the Two-Factor Authentication?

This command did not work for me.
ssh git@gitlab.example.com 2fa_recovery_codes

I used
ssh git@gitlab.com 2fa_recovery_codes
which was found here

1 Like

you can generate new codes using a machine that you have added the ssh key to your GitLab account.
Just run:

ssh git@gitlab.com 2fa_recovery_codes

Are you sure you want to generate new two-factor recovery codes?
Any existing recovery codes you saved will be invalidated. (yes/no)

type ‘yes’ and ‘enter’

Your two-factor authentication recovery codes are:
XXXXXXX
YYYYYYY
ZZZZZZZ

//Generate new recovery codes using SSH
https://www.balticlsc.eu/gitlab/help/user/profile/account/two_factor_authentication.md#generate-new-recovery-codes-using-ssh

//Other options:
https://www.balticlsc.eu/gitlab/help/user/profile/account/two_factor_authentication.md#recovery-options