简体   繁体   中英

Can not connect with ssh to an ubuntu image in Azure

I have a problem with my ubuntu vm.

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

  • c290a6b031d841e09f2da759bbabe71f__Oracle-Linux-6

After that I tried with ubuntu image:

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

And I get this:

  • debug2: bits set: 547/1024 debug1: ssh_rsa_verify: signature correct
  • debug2: kex_derive_keys debug2: set_newkeys: mode 1 debug1:
  • SSH2_MSG_NEWKEYS sent debug1: expecting SSH2_MSG_NEWKEYS debug2:
  • set_newkeys: mode 0 debug1: SSH2_MSG_NEWKEYS received debug1: Roaming
  • not allowed by server debug1: SSH2_MSG_SERVICE_REQUEST sent debug2:
  • service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received
  • debug2: key: /Users/me/vm.pem (0x0), explicit debug1: Authentications
  • that can continue: publickey debug3: start over, passed a different
  • list publickey debug3: preferred
  • publickey,keyboard-interactive,password debug3: authmethod_lookup
  • publickey debug3: remaining preferred: keyboard-interactive,password
  • debug3: authmethod_is_enabled publickey debug1: Next authentication
  • method: publickey debug1: Trying private key: /Users/me/vm.pem
  • debug1: read PEM private key done: type RSA debug3:
  • sign_and_send_pubkey: RSA
  • 6f:9c:f4:64:03:20:48:4a:bf:3f:62:74:32:61:3b:0b debug2: we sent a
  • publickey packet, wait for reply debug1: Authentications that can
  • continue: publickey debug2: we did not send a packet, disable method
  • debug1: No more authentication methods to try.

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM