# 백업에서 복원한 후 OTP 기반 2FA가 작동하지 않음

**URL:** https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453
**Category:** Support
**Created:** [5월 24, 2021, 11:57오전 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453 "2021-05-24T11:57:53Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Blechpirat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blechpirat/32/221370_2.png) [@Blechpirat](https://meta.discourse.org/u/Blechpirat)
#### Post date: [5월 24, 2021, 11:57오전 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/1 "2021-05-24T11:57:53Z")

</div>

개인 PC에서 ‘항상 켜져 있는’ 서버로 Discourse를 이전했습니다. 두 기기는 동일한 네트워크에 있습니다. Docker를 새로 생성하여 Discourse를 설치한 후, 다음 링크에 나와 있는 대로 백업을 복원했습니다: [Restore a backup from the command line](https://meta.discourse.org/t/restore-a-backup-from-command-line/108034)

모든 것이 정상적으로 작동하지만, OTP를 사용하여 2FA(2단계 인증)를 활성화한 사용자의 로그인만 문제가 있습니다. Android에서 AndOTP를 사용 중인데, OTP가 더 이상 유효하지 않습니다. 또한, 앱에서 생성된 토큰이 Discourse에서 인정되지 않아 새로운 2FA 토큰을 생성하는 것도 불가능합니다. 즉, QR 코드를 스캔하기만 했는데도 생성된 토큰이 더 이상 올바른 값이 아닙니다.

무언가를 잘못한 것일까요?

---

<div class="post-metadata">

### Author: ![Blechpirat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blechpirat/32/221370_2.png) [@Blechpirat](https://meta.discourse.org/u/Blechpirat)
#### Post date: [5월 24, 2021, 12:07오후 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/2 "2021-05-24T12:07:58Z")

</div>

문제를 좁혀 보겠습니다: 방금 Yubikey로 계정을 보호했는데, 그건 정상적으로 작동했습니다.

OTP만 문제입니다.

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [5월 24, 2021, 1:34오후 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/3 "2021-05-24T13:34:27Z")

</div>

새로운 OTP 기록을 생성하기 전에 기존 OTP 기록을 삭제해 보셨나요? 이 게시물을 참고해 보세요. [Disable 2FA via console - howto / sysadmin - Discourse Meta](https://meta.discourse.org/t/disable-2fa-via-console/148309)

---

<div class="post-metadata">

### Author: ![Blechpirat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blechpirat/32/221370_2.png) [@Blechpirat](https://meta.discourse.org/u/Blechpirat)
#### Post date: [5월 24, 2021, 3:02오후 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/4 "2021-05-24T15:02:56Z")

</div>

아니요, 그렇게 하지 않았습니다. 감사합니다. 저는 새로운 관리자 사용자를 생성하고 해당 사용자로 로그인한 후 웹 인터페이스를 통해 영향받은 사용자들의 2FA를 비활성화하는 방식으로 스스로 문제를 해결했습니다.

이제 말씀하신 링크를 따라갔습니다(감사합니다) 그리고 제 YubiKey 2FA가 비활성화되는 것까지는 성공했습니다.

하지만 OTP를 사용한 2FA를 다시 사용하는 것은요? 아니요. QR 코드를 스캔한 후 생성된 토큰이 유효하지 않아서 인증 앱 추가가 불가능합니다. 원래 인스턴스에서는 이런 문제가 없었습니다.

---

<div class="post-metadata">

### Author: ![osioke](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osioke/32/238946_2.png) [@osioke](https://meta.discourse.org/u/osioke)
#### Post date: [5월 24, 2021, 3:12오후 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/5 "2021-05-24T15:12:15Z")

</div>

> [@Blechpirat](#):
>
> 아니요. QR 코드를 스캔한 후 생성된 토큰이 유효하지 않기 때문에 인증기 앱을 추가할 수 없습니다. 이는 원래 인스턴스에서는 문제가 없었는데요.

아, 최근에 이런 문제를 본 적이 없는데, 현재 사용 중인 Discourse 버전은 무엇인가요?

---

<div class="post-metadata">

### Author: ![Benjamin\_D](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/benjamin_d/32/277831_2.png) [@Benjamin\_D](https://meta.discourse.org/u/Benjamin_D)
#### Post date: [5월 24, 2021, 9:58오후 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/6 "2021-05-24T21:58:06Z")

</div>

서버와 클라이언트 사이에 시간 차이가 있는 건가요?

---

<div class="post-metadata">

### Author: ![Blechpirat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blechpirat/32/221370_2.png) [@Blechpirat](https://meta.discourse.org/u/Blechpirat)
#### Post date: [5월 25, 2021, 11:46오전 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/7 "2021-05-25T11:46:05Z")

</div>

> [@osioke](#):
>
> 오, 최근에 이걸 못 봤는데, 현재 어떤 버전의 Discourse를 사용 중이신가요?

두 버전(백업의 원본과 백업을 복원한 시스템) 모두 2.8.0.beta1입니다.

> [@Benjamin\_D](#):
>
> 서버와 클라이언트 사이에 시간 차이가 있는 건가요?

내일 확인해 보겠습니다 - 오늘 시스템에 접근할 수 없습니다. 이것이 문제일 수도 있지만, ntp가 활성화되어 있고 서버의 내부 시계를 교정해야 하므로 상당히 확신하고 있습니다.

---

<div class="post-metadata">

### Author: ![Blechpirat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blechpirat/32/221370_2.png) [@Blechpirat](https://meta.discourse.org/u/Blechpirat)
#### Post date: [5월 26, 2021, 7:37오전 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/8 "2021-05-26T07:37:28Z")

</div>

> [@Benjamin\_D](#):
>
> 서버와 클라이언트 간 시간 차이 때문일까요?

말씀하신 대로였습니다. 그 방법으로 문제가 해결되었습니다. ntp는 설치되어 있었지만, 시간 차이가 너무 커서 ntp가 더 이상 이를 보정하지 못하고 있었습니다. 이제 수동으로 동기화를 강제했고, OTP가 다시 정상 작동합니다.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [6월 25, 2021, 7:37오전 UTC](https://meta.discourse.org/t/2fa-with-otp-broken-after-restoring-from-backup/191453/9 "2021-06-25T07:37:35Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
