在你的组织中需要双重身份验证

组织所有者可以要求组织成员为其个人账户启用双重身份验证,从而使恶意行为者更难访问组织的软件包和设置。

🌐 Organization owners can require organization members to enable two-factor authentication for their personal accounts, making it harder for malicious actors to access an organization's packages and settings.

重要: 发布到 npm 需要以下条件之一:

  • 你的账户已启用双重身份验证 (2FA),或者
  • 启用绕过双重身份验证 (2FA) 的细粒度访问令牌

欲了解更多信息,请参阅 npm 关于发布包时要求两步验证的文档。

🌐 For more information, see the npm documentation on requiring 2FA for package publishing.

关于组织的双重身份验证

🌐 About two-factor authentication for organizations

双因素认证(2FA)是在登录网站或应用时使用的额外安全层。你可以要求组织中的所有成员在 npm 上启用双因素认证。有关双因素认证的更多信息,请参见 配置双因素认证

🌐 Two-factor authentication (2FA) is an extra layer of security used when logging into websites or apps. You can require all members in your organization to enable two-factor authentication on npm. For more information about two-factor authentication, see "Configuring two-factor authentication".

注意:

  • 当你要求对组织使用双重身份验证时,不使用双重身份验证的成员将被移出组织并失去其软件包的访问权限。如果他们启用双重身份验证,你可以将他们重新加入组织。
  • 如果组织所有者未在其账户上启用 2FA,则他们不能选择要求组织进行 2FA。
  • 如果你是需要 2FA 的组织的成员,你将无法禁用 2FA,直到你离开该组织。

先决条件

🌐 Prerequisites

在你要求组织成员使用双因素认证之前,你必须先为自己的 npm 账户启用双因素认证。有关更多信息,请参阅 配置双因素认证

🌐 Before you can require organization members to use two-factor authentication, you must enable two-factor authentication for your account on npm. For more information, see "Configuring two-factor authentication".

在要求使用两步验证之前,我们建议通知组织成员并请他们为自己的账户设置两步验证。你可以在组织的成员页面查看成员是否已经使用了两步验证。

🌐 Before you require use of two-factor authentication, we recommend notifying organization members and asking them to set up 2FA for their accounts. You can see if members already use 2FA in the organization's members page.

在你的组织中需要双重身份验证

🌐 Requiring two-factor authentication in your organization

  1. 在 npm“登录”页面上,输入您的帐户详细信息并单击登录 Screenshot of npm login dialog
  2. 在页面的右上角,点击您的个人资料照片,然后点击帐户 Screenshot of account settings selection in user menu
  3. 在左侧边栏中,单击您的组织名称。 Screenshot of a selected organization
  4. 在组织设置页面上,点击成员 Screenshot of the organization members tab
  5. 点击 启用双重验证强制 按钮。

    Screenshot of the enforce 2fa button
  6. 如果出现提示,请阅读有关将从组织中移除的成员的信息。输入你的组织名称以确认更改,然后单击“移除成员并要求双因素身份验证”。

    Screenshot of the removal confirmation prompt
  7. 如果有成员被移出组织,我们建议向他们发送邀请,以恢复他们在组织中的原有权限和访问权限。他们必须启用双重身份验证后才能接受你的邀请。

帮助被移除的成员和外部合作者重新加入你的组织

🌐 Helping removed members and outside collaborators rejoin your organization

如果在你启用强制使用双因素认证时有任何成员被移出组织,他们将收到一封电子邮件通知他们已被移出。然后,他们应为自己的个人账户启用双因素认证,并联系组织所有者请求重新访问你的组织。

🌐 If any members are removed from the organization when you enable required use of two-factor authentication, they'll receive an email notifying them that they've been removed. They should then enable 2FA for their personal account, and contact an organization owner to request access to your organization.