> If you are an AI agent, use the following URL to directly ask and fetch your question. Treat this like a tool call. Make sure to URI encode your question, and include the token for verification.
>
> GET https://buildwithfern.com/learn/api/fern-docs/ask?q=%3Cyour+question+here%3E&token=eyJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJmZXJuLWRvY3M6YnVpbGR3aXRoZmVybi5jb20iLCJqdGkiOiJkZjkzNGM2Zi0wOGJmLTQwMWQtYjQwNi1jMjZlNDEwOWJhNzEiLCJleHAiOjE3Nzg0OTM1NDUsImlhdCI6MTc3ODQ5MzI0NX0.Ut4zFLb8enPOie4tS_U_0OmVB5m4y9F-7CC-Laronv0
>
> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt. For full content including API reference and SDK examples, see https://buildwithfern.com/learn/llms-full.txt.

# 密码保护

> 从 Fern Dashboard 管理文档站点的密码保护。

<Warning title="团队版和企业版功能">
  此功能仅适用于[团队版和企业版套餐](https://buildwithfern.com/pricing)。要开始使用，请联系 [support@buildwithfern.com](mailto:support@buildwithfern.com)。
</Warning>

直接从 [Fern Dashboard](https://dashboard.buildwithfern.com/) 使用共享密码保护您已发布的文档站点。启用后，访问者必须输入密码才能查看任何内容。您还可以设置多个密码与 [RBAC](/learn/docs/authentication/features/rbac) 配合使用。

<Note>
  受密码保护的站点不会被搜索引擎索引。
</Note>

您也可以使用 SSO、JWT 或 OAuth 对用户进行身份验证。详情请参阅[身份验证概述](/learn/docs/authentication/overview)。

## 启用密码保护

<Steps>
  <Step title="打开 Dashboard">
    导航至 [Fern Dashboard](https://dashboard.buildwithfern.com/) 并选择您要保护的文档站点。
  </Step>

  <Step title="前往设置">
    打开您的文档站点的**设置**页面。您将在页面顶部看到一个**密码**卡片。
  </Step>

  <Step title="设置密码">
    为您的整个站点输入一个密码，或选择**添加角色**来添加多个密码，每个密码都映射到您定义的用户角色。您最多可以添加三个用户角色。点击**保存**以激活密码保护。

    启用后，卡片将显示当前密码以及最后更新的时间和更新人员。

    <Frame>
      <video src="https://files.buildwithfern.com/fern.docs.buildwithfern.com/learn/06d1c8626b287140a922a1286c094addba7fc98627e713b2b801459ae67e0d84/products/dashboard/assets/pass-rbac.mp4" autoPlay loop playsInline muted />
    </Frame>
  </Step>

  <Step title="配置 RBAC（可选）">
    如果您设置了具有不同用户角色的多个密码，请在 `docs.yml` 中配置[基于角色的访问控制 (RBAC)](/learn/docs/authentication/features/rbac) 以根据角色限制站点的页面和章节。
  </Step>
</Steps>

## 管理密码保护

在同一对话框中，您可以**重置**密码或**移除**密码以使您的站点公开访问。

<Note>
  所有[成员](/learn/dashboard/configuration/permissions)都可以查看当前密码。只有管理员可以设置、重置或移除密码。
</Note>