api - 无法通过 SSH 连接到 Windows Azure 虚拟机

标签 api rest azure ssh

我正在测试 Windows Azure 的 IaaS 部分,并且已经通过 REST API 成功部署了各种虚拟机实例。用于启动 VM 的 POST 请求的 XML 正文如下:

<Deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <Name>Azure</Name>
  <DeploymentSlot>Production</DeploymentSlot>
  <Label>Azure IM created VM</Label>
  <RoleList>
    <Role i:type="PersistentVMRole">
      <RoleName>IMVMRole</RoleName>
      <OsVersion i:nil="true"/>
      <RoleType>PersistentVMRole</RoleType>
      <ConfigurationSets>

        <ConfigurationSet i:type="LinuxProvisioningConfigurationSet">
          <ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType>
          <HostName>AzureNode</HostName>
          <UserName>user</UserName>
          <UserPassword>Prueba+1111</UserPassword>
          <DisableSshPasswordAuthentication>false</DisableSshPasswordAuthentication>
        </ConfigurationSet>

        <ConfigurationSet i:type="NetworkConfigurationSet">
          <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType>
          <InputEndpoints>
            <InputEndpoint>
              <LocalPort>22</LocalPort>
              <Name>SSH</Name>
              <Port>22</Port>
              <Protocol>TCP</Protocol>
            </InputEndpoint>
          </InputEndpoints>
        </ConfigurationSet>
      </ConfigurationSets>
      <Label>Azure IM created VM</Label>

      <OSVirtualHardDisk>
        <MediaLink>https://XXXXXXX.blob.core.windows.net/vhds/0b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.4.vhd</MediaLink>
        <SourceImageName>0b11de9248dd4d87b18621318e037d37__RightImage-Ubuntu-12.04-x64-v13.4</SourceImageName>
      </OSVirtualHardDisk>
      <RoleSize>Small</RoleSize>
    </Role>
  </RoleList>
</Deployment>

但是,当我尝试使用 Putty 通过 SSH 连接到虚拟机时,当我尝试通过用户/密码进行身份验证时,它会显示以下消息(请注意,在 XML 正文中我已指定 DisableSshPasswordAuthentication = false):“已断开连接” :没有可用的受支持的身份验证方法(服务器发送:公钥)”。

非常感谢整个 stackoverflow 社区的帮助。 阿贝尔。

最佳答案

如果有人尝试通过命令行连接到虚拟机,但在之前通过 SSH 成功连接后根本无法连接:

转至虚拟机菜单“支持 + 故障排除”部分中的“重置密码”,然后选择模式“重置公共(public) SSH key ”和“更新”。这不会删除或更改初始部署期间提供的 key ,因此您可以在成功重置后像之前一样进行连接。

关于api - 无法通过 SSH 连接到 Windows Azure 虚拟机,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17446386/

相关文章:

java - 使用 Apache CXF 3 和 JAX-RS 2.0 添加客户端代理

rest - 我应该在 RESTful 服务中拥有多个资源 View /端点吗?

windows - 通过 TeamCity 执行时 dos2unix 格式转换错误

azure - 处理Azure数据工厂管道中的空值

java - 使用wiremock进行Rest API模拟: java

android - 用于 native 客户端(android、iOS)的超媒体 API?

javascript - 如何在 Photoshop JavaScript API 中加载图层透明度并另存为路径?

azure - ASP.NET Core Web API + Azure AD 身份验证

php - Yii2 REST API 作为模块路由配置

ruby-on-rails - 授予 API 访问 Rails 应用程序的最佳身份验证方法