Home > Articles > Details

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?



Please 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 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 [email protected]"
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.



If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.


© 2022 - ErnesTech - Privacy