# 4.禁用新用户注册

{% hint style="success" %}
对应的[官方页面地址](https://github.com/dani-garcia/vaultwarden/wiki/Disable-registration-of-new-users)
{% endhint %}

默认情况下，可以访问实例的任何人均可以注册新的账户。要禁用该功能，请将 `SIGNUPS_ALLOWED` 环境变量设置为 `false`：

```shell
docker run -d --name vaultwarden \
  -e SIGNUPS_ALLOWED=false \
  -v /vw-data/:/data/ \
  -p 80:80 \
  vaultwarden/server:latest
```

**注意**：当 `SIGNUPS_ALLOWED=false` 时，网页密码库用户界面将不会显示 `Create Account` 按钮。 无论设置如何，仍然可以邀请。

## 禁用组织邀请 <a href="#disabling-organization-invitations" id="disabling-organization-invitations"></a>

即使 `SIGNUPS_ALLOWED=false`，作为组织的所有者或管理员的现有用户仍然可以邀请新用户。如果您也想禁用此功能，请参阅[禁用邀请](/configuration/disable-invitations.md)。

## 将注册限制为某些电子邮箱域名 <a href="#restricting-registrations-to-certain-email-domains" id="restricting-registrations-to-certain-email-domains"></a>

您可以通过设置 `SIGNUPS_DOMAINS_WHITELIST` 来限制只能某些域名的电子邮箱地址可以注册。示例：

* `SIGNUPS_DOMAINS_WHITELIST=example.com` （单个域名）
* `SIGNUPS_DOMAINS_WHITELIST=example.com,example.net,example.org` （多个域名）

{% hint style="warning" %}
如果设置了 `SIGNUPS_DOMAINS_WHITELIST`，`SIGNUPS_ALLOWED=false`的值将被忽略。
{% endhint %}

您可能还想设置 `SIGNUPS_VERIFY=true`，这要求新注册的用户在成功登录前进行电子邮箱验证。这可以防止有人用一个拥有正确域名的假电子邮箱地址注册。

## 创建账户链接的可见性 <a href="#visibility-of-the-create-account-link" id="visibility-of-the-create-account-link"></a>

当 `SIGNUPS_ALLOWED=false`（且 `SIGNUPS_DOMAINS_WHITELIST` 为空）时，网页密码库 UI 中的创建账户链接将隐藏，除非您没有[配置电子邮箱](/configuration/smtp-configuration.md)和允许邀请（参见 [#6109](https://github.com/dani-garcia/vaultwarden/issues/6109)）。如果在后一种情况下也不想让链接可见，可以使用[自定义 CSS](/customization/customize-vaultwarden-css.md) 隐藏链接。

## 通过管理页面邀请 <a href="#invitations-via-the-admin-page" id="invitations-via-the-admin-page"></a>

Vaultwarden 管理员可以通过[管理页面](/configuration/enabling-admin-page.md)邀请任何人，不受以上限制。如果 SMTP 被禁用，用户应访问 `https://vaultwarden.example.tld/#/signup` 然后使用邀请的电子邮箱注册。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://rs.ppgg.in/configuration/disable-registration-of-new-users.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
