-1

Could not connect using Win10 BASH subsystem to newly created Azure Ubuntu server, the Microsoft technicians were unable to help but it appears that there is some kind of key issue. I used the following doc "https://docs.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal" to learn Azure using the portal but they and I, could not get it to connect.

Update 1/2/2017:

Was able to connect using the -i ~/.ssh/name_of_the_keyfile appended to the ssh command. Thank You

Itai Ganot
  • 10,424
  • 27
  • 88
  • 143

2 Answers2

2

I used the following doc "https://docs.microsoft.com/en-us/azure/virtual-machines/linux/quick-create-portal" to learn Azure using the portal but they and I, could not get it to connect. Any ideas?

Have you run this command ssh-keygen -t rsa -b 2048 in Win10 BASH subsystem?

We can find them in your home directory:

enter image description here

Then we should use this pub key to create Azure VM(copy this key to SSH public key):

enter image description here

After that VM create completed, we can use ssh to connect to that Azure VM:

enter image description here

If you can't use that key to login Azure VM, we can follow this article to reset SSH public Key:

enter image description here

Hope this helps.

Jason Ye
  • 2,399
  • 1
  • 8
  • 10
  • It worked! Please tell the Microsoft Technicians to have customers try using the: -i ~/.ssh/name_of_the_key_file That was the root cause of the failure to connect! – JohnnyRocket Jan 02 '18 at 23:37
  • @JohnnyRocket OK, please don't forget to [accept](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) it as an answer so that other community members will be benefited, thanks:) – Jason Ye Jan 03 '18 at 05:56
1

I've never worked on Azure before but I believe it's like other cloud services.

When you create a machine in a cloud service provider you choose which private key to use to connect to the machine you just created.

Or if you create a new key then upon creation the key will be downloaded to your windows machine.

Then you should copy that private key to the bash subsystem and use when connecting to your Azure machine, like so:

ssh -i ~/.ssh/Azure_rsa_id.pem user@host_of_azure

But first I would try Putty to understand if the issue is related to the Win10 subsystem or to the key.

I think that in order to connect from Putty you will have to convert the private key using PuttyGen.

Itai Ganot
  • 10,424
  • 27
  • 88
  • 143