How to Connect to Azure Lunux Virtual Machine Using SSH Private Key in Putty


Question: When I try to log into Microsoft Azure Portal Linux Virtual Machine using Putty with an SSH Private Key, I get "No support authentication method available (server sent:publickey). What is going on?



Login to See the Rest of the Answer

Answer:
PuTTY expectest your SSH Private Key to be in a different format while Microsoft Azure generated an SSH Private Key that is a different format. In order to log into Azure Linux Virtual Machine (Azure VM) you need to follow the steps below:

1. Create a folder on your Local Machine
2. Paste the SSH Private Key in that folder
3. Set strong permission as follow:
      1. Right-click on the folder in that you pasted the SSH Private Key
      2. Navigate to Properties
      3. Click on "Security"
      4. Click on "Advanced Security"
      5. Change the Ownership of the folder to you, your account
      6. Disable Inheritance
      7. Make sure that you remove other accounts in the "Permission Entry" box. Only you should be able to access the .pem file (Private SSH Key).
       8. Hit Apply and Save.
4. Start Powershell or Windows terminal
5. Type in "ssh -i PathToYourPemFileOrSSHKey UserNameYouSetOnAzureVM@AzureVMPublicIP"
6. Click Enter, and type "yes" on the prompt.

You should be able to log into Azure VM using a Private Key with a .pem extension in Windows Terminal or Powershell.



How to Connect to Azure Linux Virtual Machine Using SSH Private Key in Putty

Edited Version 2

Question
When I try to log into Microsoft Azure Portal Linux Virtual Machine using Putty with an SSH Private Key, I get "No support authentication method available (server sent
publickey)
. What is going on?


Answer
PuTTY expects your SSH Private Key to be in a different format while Microsoft Azure generated an SSH Private Key that is a different format. In order to log into Azure Linux Virtual Machine (Azure VM) you need to follow the steps below


1. Create a folder on your Local Machine
2. Paste the SSH Private Key in that folder
3. Set strong permission as follow

      1. Right-click on the folder that you pasted the SSH Private Key
      2. Navigate to Properties
      3. Click on "Security"
      4. Click on "Advanced Security"
      5. Change the Ownership of the folder to you, your account
      6. Disable Inheritance
      7. Make sure that you remove other accounts in the "Permission Entry" box. Only you should be able to access the .pem file (Private SSH Key).
       8. Hit Apply and Save.
4. Start Powershell or Windows terminal
5. Type in "ssh -i PathToYourPemFileOrSSHKey UserNameYouSetOnAzureVM@AzureVMPublicIP"
6. Click Enter, and type "yes" on the prompt.

You should be able to log into Azure VM using a Private Key with a .pem extension in Windows Terminal or Powershell.







For peering opportunity Autonomouse System Number: AS401345 Custom Software Development at ErnesTech Email Address[email protected]