配合 2fa 命令行工具使用,从 Google Authenticator 导出数据中提取 OTP 密钥。
解码 Google Authenticator 导出的迁移 URI,提取密钥后添加到 2fa 工具中使用。
go install github.com/JeaNile/gotp@latest或下载 预编译二进制。
- 打开 Google Authenticator 应用
- 点击右上角 "..." → "转移账号" → "导出账号"
- 使用二维码扫描工具读取二维码内容(格式:
otpauth-migration://offline?data=...)
gotp decode "otpauth-migration://offline?data=..."输出示例:
======================================================================
找到 1 个账号:
======================================================================
账号 #1:
名称: user@example.com
发行者: Aliyun
密钥: LJRNKYKxxxxxxxxxxxx
类型: TOTP
位数: 6
当前动态口令: 123456
验证密钥是否正确:
gotp verify LJRNKYKxxxxxxxxxxxx 123456MIT