Abe*_*UPV 5 api rest ssh azure
我正在测试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>
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试通过使用Putty的SSH通过SSH连接到VM时,当我尝试通过用户/密码进行身份验证时会显示以下消息(请注意,在XML主体中,我已指定DisableSshPasswordAuthentication = false):“已断开连接:不支持可用的身份验证方法(服务器发送:publickey)”。
非常感谢整个stackoverflow社区的帮助。亚伯
如果有人尝试通过命令行连接到虚拟机,但在之前通过 SSH 成功连接后根本无法连接:
转到虚拟机菜单的“支持 + 故障排除”部分中的“重置密码”,然后选择模式“重置公共 SSH 密钥”和“更新”。这不会删除或更改初始部署期间提供的密钥,因此您可以在成功重置后像之前一样进行连接。
归档时间: |
|
查看次数: |
1557 次 |
最近记录: |