azure云数据库_在Azure SQL数据库中配置多重身份验证

azure云数据库

介绍 (Introduction)

The new SSMS 17.2 allows users to authenticate using Active Directory with Multi-Factor Authentication (MFA). This is a secure method for authentication where you have more than one method to validate your authentication. That way, you have a more secure authentication and prevent your Azure Portal or applications to be easily attacked by hackers or other malicious users.

新的SSMS 17.2允许用户使用带有多因素身份验证(MFA)的Active Directory进行身份验证。 这是一种安全的身份验证方法,您可以使用多种方法来验证身份。 这样,您就可以进行更安全的身份验证,并防止Azure门户或应用程序容易受到黑客或其他恶意用户的攻击。

MFA uses a two-step verification. For example, you can authenticate with a login and password, and, receive a code on your cell phone to increase the security and makes it harder to hack your data. Another option is to install an app to verify your password.

MFA使用两步验证。 例如,您可以使用登录名和密码进行身份验证,并在手机上接收代码以提高安全性,并更难于破解您的数据。 另一种选择是安装应用程序以验证您的密码。

With MFA, you do not need to install third party security solution, SSL Certificates or other more complex security solutions.

使用MFA,您无需安装第三方安全解决方案,SSL证书或其他更复杂的安全解决方案。

In this demonstration, we will show how to authenticate in SSMS using the Active Directory Universal – MFA authentication.

在此演示中,我们将展示如何使用Active Directory Universal – MFA身份验证在SSMS中进行身份验证。

To do that, we do the following steps:

为此,我们执行以下步骤:

  1. Create an Active Directory user (AD user)

    创建一个Active Directory用户(AD用户)
  2. Enable MFA for the user

    为用户启用MFA
  3. Add the user as an Azure SQL Administrator

    将用户添加为Azure SQL管理员
  4. Login with SSMS using the user created (specify your password and cell phone SMS code)

    使用创建的用户使用SSMS登录(指定您的密码和手机短信代码)

要求 (Requirements)

  1. An Azure Account Azure帐户
  2. Working with Visual Studio and SQL Azure databases to create the database) “使用Visual Studio和SQL Azure数据库创建数据库”)
  3. SQL Server Management Studio (SSMS) version 17.2 installed

    已安装SQL Server Management Studio(SSMS)版本17.2
  4. A firewall activated to connect SSMS to Azure SQL Server.

    已激活防火墙,以将SSMS连接到Azure SQL Server。

Let’s get started…

让我们开始吧…

创建一个AD用户 (Create an AD user)

We will create an Active Directory user in Azure. If you want to get more information about Azure Active Directory, we recommend reading our articles on this topic:

我们将在Azure中创建一个Active Directory用户。 如果要获取有关Azure Active Directory的更多信息,建议阅读有关此主题的文章:

In the web Portal, we have a database named sqlshack and an Azure Server whose name is sqlshackserver.database.windows.net. We will connect to this Azure SQL server using the AAD user later:

在Web门户网站,我们有一个数据库名为sqlshack和Azure的服务器名称为sqlshackserver.database.windows.net。 我们稍后将使用AAD用户连接到该Azure SQL服务器

We will create a User for that database. To do that, in the Portal, go to more services>User and Groups:

我们将为该数据库创建一个用户。 为此,在门户中,转到更多服务>用户和组

If you do not have an AAD user, you need to create a new one. Select All Users and then select New User:

如果您没有AAD用户,则需要创建一个新用户。 选择所有用户 ,然后选择新用户:

At the top corner, click on your user. You will find your Azure domain name there copy the domain name because it will be used to write the Azure Active Directory User name:

在右上角,单击您的用户。 您将在其中找到您的Azure域名,将其复制到该域名,因为它将用于写入Azure Active Directory用户名:

Add the user name and the name. The user name should include the domain name. You can optionally setup the profile, properties, group and other options:

添加用户名和名称。 用户名应包括域名。 您可以选择设置配置文件,属性,组和其他选项:

为用户启用MFA (Enable MFA for the user)

We will now enable MFA for the user created.

现在,我们将为创建的用户启用MFA。

Click the Multi-Factor Authentication icon:

单击多重身份验证图标:

Select the users that you want to update and change the authentication to Multi-Factor Authentication (MFA). You can select multiple users. By default, MFA is disabled for all users:

选择要更新的用户,然后将身份验证更改为“多重身份验证(MFA)”。 您可以选择多个用户。 默认情况下,所有用户均禁用MFA:

There is an option for bulk update. This option is useful if you have several users. You can open a CSV file in Excel or any program of your preference to edit and upload the file.

有批量更新的选项。 如果您有多个用户,此选项很有用。 您可以在Excel或您喜欢的任何程序中打开CSV文件来编辑和上传文件。

The format is like the following:

格式如下:

Username, MFA Status
chris@contoso.com, Enabled
ben@contoso.com, Disabled
kyle@contoso.com, Disabled
kenny@contoso.com, Enabled
eric@contoso.com, Enabled

用户名,MFA状态
chris@contoso.com,已启用
ben@contoso.com,已禁用
kyle@contoso.com,已禁用
kenny@contoso.com,已启用
eric@contoso.com,已启用

The CSV file requires the user name and the status required. You can handle and set thousands of users at the same time using the bulk update option.

CSV文件需要用户名和所需状态。 您可以使用批量更新选项同时处理和设置数千个用户。

In this example, we will just enable the user jlopez just created. When you press the Enable option, you will receive this message. Press the enable multifactor auth button to enable MFA for the user selected:

在此示例中,我们将仅启用刚刚创建的用户jlopez 。 当您按启用选项时,您会收到此消息。 按启用多因素身份验证按钮为所选用户启用MFA:

There is also a link to setup the users directly. We will now use this option because we want to activate the user using SSMS.

还有一个链接可以直接设置用户。 现在,我们将使用此选项,因为我们想使用SSMS激活用户。

将用户添加为Azure SQL管理员 (Add the user as an Azure SQL Administrator)

We will add the user created to our Azure SQL Server as an AD Administrator.

我们将创建的用户作为AD管理员添加到Azure SQL Server中。

In the Azure Portal, go to more services>SQL servers:

在Azure门户中,转到更多服务> SQL服务器:

Select the sqlshackserver with the Azure Database that you want to connect to using MFA:

选择要使用MFA连接到的带有Azure数据库的sqlshackserver

In your Azure SQL Server, go to Active Directory admin, press Set admin and select the Azure Active Directory (AAD) user created. Once that the administrator is set, press Save:

在您的Azure SQL Server中,转到Active Directory管理员,按Set admin并选择创建的Azure Active Directory(AAD)用户。 设置管理员后,按保存

使用创建的用户登录SSMS (Login with SSMS using the user created)

We will finally login with SSMS 17.2 or later using the AAD User just created. In earlier versions, the MFA support was not included.

我们最终将使用刚刚创建的AAD用户以SSMS 17.2或更高版本登录。 在早期版本中,不包括MFA支持。

In SSMS, connect to Azure using the new feature Active Directory – Universal with MFA support:

在SSMS中,使用新功能Active Directory –具有MFA支持的Universal连接到Azure

The first time that you try login, you will be prompted to login and specify your password:

首次尝试登录时,系统将提示您登录并指定密码:

After login, press the Set it up now button:

登录后,按立即设置按钮:

You can receive a call with the code or a SMS message. You do not need a smartphone to authenticate. Specify your country and cell phone number:

您可以使用代码或SMS消息接听电话。 您不需要智能手机即可进行身份验证。 指定您的国家和手机号码:

You will receive a confirmation code in a SMS message or a call in your cell phone (according to your settings):

根据您的设置,您将通过短信或手机呼叫收到确认码:

Write the code from your cell phone and press Verify:

从您的手机编写代码,然后按验证:

You will receive a successful message. Press Done.

您将收到一条成功消息。 按完成

If you did not reset the password before, you may receive a message to update your password:

如果您之前未重设密码,则可能会收到一条消息以更新密码:

If you do not remember your password, go to the Azure Portal, more services>Users and groups. Click on the user that you want to reset the password:

如果您忘记了密码,请转到Azure门户,更多服务>用户和组。 单击您要重置密码的用户:

In the user properties, press the reset password option:

在用户属性中,按重置密码选项:

You will receive a message. Press the reset password and use the temporary password to login in SSMS:

您将收到一条消息。 按下重置密码并使用临时密码登录SSMS:

After specifying the credentials, you will be able to login to the SSMS successfully:

指定凭据后,您将能够成功登录到SSMS:

This information will be required just once. The next time, you will not need to specify the login information.

仅需一次此信息。 下次,您将不需要指定登录信息。

结论 (Conclusion)

As you can see, MFA is a new way to authenticate that is supported in SSMS version 17.2.

如您所见,MFA是SSMS版本17.2支持的一种新的身份验证方法。

This feature allows having a more secure login where you receive a call or an SMS message in your cell phone to confirm the code received.

使用此功能可以更安全地登录,您可以在手机上收到电话或SMS消息以确认收到的密码。

This feature is simple, integrated with Active Directory and can be applied to multiple technologies that integrates with Azure.

此功能很简单,与Active Directory集成在一起,可以应用于与Azure集成的多种技术。

翻译自: https://www.sqlshack.com/configure-multi-factor-authentication-azure-sql-database/

azure云数据库

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值