在启动虚拟机时,Azure 中有可用的启动诊断日志,默认启用。您可以通过在 Azure 门户中选择虚拟机来找到它们;在菜单部分“支持+故障排除”中,选择“引导诊断”,然后选择“串行日志”标签页。这些日志以 JSON 对象的形式列出各种系统参数,其中包含如下所示的remoteAccess 对象。
"remoteAccess": {
"windows": {
"rdpPort": 3389,
"rdpEnabled": true,
"rdpTcpListenerSecurityConfiguration": {
"nlaUserAuthenticationRequired": true,
"authenticationSecurityLayer": "TLS",
"protocolNegotiationAllowed": true
},
"rdpTcpListenerMaxConnections": 2,
"rdpFirewallAccess": "Allowed",
"rdpAllowedUsers": [
"TestUser"
],
"rdpCertificateDetails": {
"subject": "CN=RDPTest",
"thumbprint": "9AD7CB3493790BCAB6FBF543EBBBE68883E9EE89",
"validFrom": "2018-02-17T10:58:42Z",
"validTo": "2018-08-19T10:58:42Z"
},
"rdsLicensingStatus": null
}
}
如您所见,有一个rdpCertificateDetails 对象列出了 RDP 服务器证书的 SHA 指纹。与 Linux 启动诊断日志不同,它每次都会列出指纹,因此如果没有在第一次启动时记录下来,则无需担心。
首次连接时,会出现“未知发布者”警告。
单击并输入您的凭据。输入您的凭据后,它将显示“无法验证身份”警告。计算机的名称将是 Azure 中 VM 的名称。
单击查看证书,然后转到详细信息。您可以在此处找到指纹,以根据启动诊断中的指纹进行验证。
有关在 Azure 门户中查找启动诊断以及获取 Linux VM 的 SSH 密钥的更详细说明,请参阅我在 this StackOverflow question 上的回答。