Files
nyaterm/docs-site/docs/guide/otp-and-auth.md
T
KangandClaude Opus 5 e18cb3902e docs: cut the template phrasing and the authoring notes
The migrated prose leaned on a small set of constructions and repeated them
until they stopped carrying information. Across ~3.7k lines the source had 78
uses of "适合", 63 of "如果你", and 34 contrastive "而不是" clauses, most of
them attached to bullet lists that restated the feature name.

What changed:
- Replaced the "适合场景 / 适合:" tail hanging off nearly every section with
  either a plain sentence or nothing. "适合" is now 0, "如果你" is 0, and the
  18 remaining "而不是" clauses each rule out an assumption a reader would
  actually make (a rejected password is not truncated; a font name is not a
  bundled file; a decoder panic must not exit silently).
- Removed the closing editorial lines that asserted significance without adding
  information ("这也是 NyaTerm 和普通多标签终端差异较大的地方"), and the
  meta-commentary where the docs explained their own conventions.
- Dropped the relative time anchors that were already going stale: "新的 SFTP
  后端", "较新的工作区", "现在可以", "Newer Agent workflows".
- Deleted the "如果你准备录制文档素材" passage, which told the reader how to
  stage screenshots for the docs rather than how to use the recorder.
- Removed seven `:::tip Screenshot suggestion` blocks that shipped only in the
  English pages. They were internal authoring notes and pointed at a
  /img/docs/ tree and scripts/demo-*.sh files that do not exist in this repo.
- Dropped "推荐的工作流组合", four permutations of features documented
  elsewhere, and gave the synchronized input group one home instead of the
  three partial copies it had across two pages.
- Rewrote the cloud-sync conflict choices to lead with what is lost, since
  "适合:你确认云端版本才是应该保留的版本" buried the fact that local
  unsynced changes are discarded.

Also closes the remaining English gaps found while doing this: selection and
bulk operations, content-fingerprint upload, two FAQ entries, and two
quick-start steps existed only in Chinese. Chinese and English now carry the
same heading count on every page.

Verified with `pnpm --dir docs-site build` (both locales) and by re-resolving
all 22 cross-page anchors against the generated heading ids.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-22 11:27:47 +08:00

2.4 KiB
Raw Blame History

OTP 与认证

NyaTerm 把 OTP 管理和 SSH 认证流程结合在了一起:你既可以把 OTP 当作一个独立的验证码仓库来管理,也可以把它直接绑定到 SSH 连接中,减少重复输入。

支持的 OTP 类型

当前支持:

  • TOTP
  • HOTP

创建或编辑 OTP 条目时,可以配置:

  • issuer
  • username
  • secret
  • 算法(SHA-1 / SHA-256 / SHA-512)
  • 位数
  • 周期(TOTP)
  • 计数器(HOTP)

在哪里管理 OTP

请打开 Security/Auth 面板中的 OTP 标签页。

你可以在这里:

  • 新建 OTP 条目
  • 编辑已有条目
  • 删除条目
  • 查看验证码
  • 从二维码图片导入

从二维码导入

已有 MFA / 2FA 二维码时可以直接导入图片文件。

典型流程:

  1. 在 OTP 面板中点击二维码导入
  2. 选择本地图片文件
  3. NyaTerm 解析后自动填充 issuer、username、secret 等信息
  4. 确认后保存为一个 OTP 条目

这样不必手动抄写 secret,也便于批量整理认证资料。

绑定到 SSH 连接

在 SSH 连接表单的高级区域中,可以为连接选择一个已保存的 OTP 条目。

绑定后你可以:

  • 在认证时快速查看当前验证码
  • 在支持的交互流程中启用 自动填充 OTP

用于需要「密码 / 私钥 + 二次验证码」组合认证的环境。

认证弹窗中的 OTP 交互

当 SSH 服务器进入 keyboard-interactive / OTP 流程时,NyaTerm 会弹出 OTP 对话框。

对话框中会显示:

  • 当前连接名称
  • 服务端要求输入的提示项
  • 如果该连接绑定了 OTP,还会显示验证码面板

你可以:

  • 手动输入验证码
  • 直接把当前 OTP 验证码发送到输入框
  • 提交或取消本次认证

自动填充 OTP

如果某个 SSH 连接已经绑定了 OTP 条目,还可以启用 自动填充 OTP。

用于:

  • 固定资产环境
  • 跳板机 / 堡垒机需要验证码
  • 高频重复登录的运维场景

建议只对你明确掌握认证流程的连接开启,避免在不兼容的交互提示上产生误填。

与密码 / 私钥的关系

OTP 不是替代密码或私钥,而是和它们配合使用:

  • 密码 + OTP
  • 私钥 + OTP

因此更推荐的管理方式是:

  1. 在 Security/Auth 中先分别整理好密码、私钥、OTP
  2. 再在具体 SSH 连接中绑定这些材料

这样连接配置会更干净,也更方便后续统一替换认证信息。