无法使用SSH连接到Azure中的ubuntu映像 [英] Can not connect with ssh to an ubuntu image in Azure

查看:66
本文介绍了无法使用SSH连接到Azure中的ubuntu映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的Ubuntu虚拟机有问题.

I have a problem with my ubuntu vm.

当我测试我的应用程序时,此图像的ssh身份验证工作正常:

When I tested my application th ssh authentication worked fine with this image:

  • c290a6b031d841e09f2da759bbabe71f__Oracle-Linux-6

之后,我尝试使用ubuntu图片:

After that I tried with ubuntu image:

  • b39f27a8b8c64d52b05eac6a62ebad85__Ubuntu-14_04-LTS-amd64-server-20140618.1-en-us-30GB

我明白了:

  • debug2:设置的位:547/1024 debug1:ssh_rsa_verify:签名正确
  • debug2:kex_derive_keys debug2:set_newkeys:模式1 debug1:
  • SSH2_MSG_NEWKEYS发送了debug1:正在等待SSH2_MSG_NEWKEYS调试2:
  • set_newkeys:模式0 debug1:SSH2_MSG_NEWKEYS收到debug1:漫游
  • 服务器debug1不允许:SSH2_MSG_SERVICE_REQUEST发送了debug2:
  • service_accept:ssh-userauth调试1:收到SSH2_MSG_SERVICE_ACCEPT
  • debug2:密钥:/Users/me/vm.pem(0x0),显式debug1:身份验证
  • 可以继续:publickey debug3:重新开始,传递了另一个
  • 列出publickey debug3:首选
  • 公钥,交互式键盘,密码debug3:authmethod_lookup
  • 公钥debug3:首选:键盘交互,密码
  • debug3:authmethod_is_enabled公钥debug1:下次身份验证
  • 方法:公钥调试1:尝试私钥:/Users/me/vm.pem
  • debug1:已完成读取PEM私钥:输入RSA debug3:
  • sign_and_send_pubkey:RSA
  • 6f:9c:f4:64:03:20:48:4a:bf:3f:62:74:32:61:3b:0b debug2:我们发送了
  • 公钥包,等待回复debug1:可以进行身份​​验证
  • 继续:公钥debug2:我们没有发送数据包,请禁用方法
  • debug1:没有更多尝试使用的身份验证方法.

权限被拒绝(公钥).我检查了密码验证,并且authorized_keys文件不包含密钥(但是我不知道为什么).

Permission denied (publickey). I checked with password authentication and the authorized_keys file does not contain the key (But I don't know why).

非常奇怪的是,当我尝试使用相同的键在Azure UI上创建实例时,一切正常.

The very wierd thing is when I tried to create an instance on Azure UI with the same key then everything works fine.

知道我为什么要得到这个吗?

Any idea why i get this?

推荐答案

确保要发布到Azure API的sha指纹是大写的.此过程由Ubuntu上的cloud-init处理,您发布的指纹保存在/var/lib/waagent/ovf-env.xml中.稍后 DataSourceAzure.py >会尝试将crt文件/var/lib/waagent/{thumbprint} .crt 转换为公钥,其中{thumbprint}来自ovf-env.xml.但是,它尝试转换的crt文件始终使用大写名称检索.在/var/lib/boot.log 中检查此行,{thumbprint}将大写:

Make sure that the sha thumbprint you're posting to the Azure API is uppercase. This process is handled by cloud-init on Ubuntu and the thumbprint you've posted is saved in /var/lib/waagent/ovf-env.xml. Later DataSourceAzure.py will try to convert the crt file /var/lib/waagent/{thumbprint}.crt to public key, where {thumbprint} comes from ovf-env.xml. But the crt file it is trying to convert is always retrieved with an upper-case name. Check this line in /var/lib/boot.log, {thumbprint} will be upper-case:

Public cert with thumbprint: {thumbprint} was retrieved.

这篇关于无法使用SSH连接到Azure中的ubuntu映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆