LoginSignup
1
2

More than 3 years have passed since last update.

sshでGitLab2段階認証リカバリーコードを再発行

Posted at

2段階認証の端末をなくし、リカバリーコードもないが、秘密鍵は残っていてsshはできる場合

運用者に問い合わせしなくても、 ssh でリカバリーコードを再発行できます。
助かりました。

$ 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)
yes

Your two-factor authentication recovery codes are:

****************
****************
****************
****************
****************
****************
****************
****************
****************
****************

During sign in, use one of the codes above when prompted for
your two-factor code. Then, visit your Profile Settings and add
a new device so you do not lose access to your account again.

教訓

リカバリーコードはちゃんと控えておきましょう

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2