Azure VM creation using ssh public key source=use existing public key

Santosh Reddy 21 Reputation points
2022-03-10T09:30:47.237+00:00

Greetings,

I created a VM using "use existing public key". When I try logging into Linux Server using SSH, I'm getting error as "Permission denied (publickey)". In case if I select "use existing key stored in Azure", it is working as expected.

Can you please suggest why I'm getting this error.

Regards,
Santosh

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,013 questions
{count} votes

Accepted answer
  1. srbhatta-MSFT 8,586 Reputation points Microsoft Employee
    2022-03-10T14:09:36.877+00:00

    Hi @Santosh Reddy ,
    Can you reset the password from portal using Reset password option. Select Reset SSH keys. Type in the username and again paste the public key. Make sure that no extra spaces or line is added. Select update. Then try reconnecting via SSH, it should work. Incase it doesn't , there are high chances the public key might have been modified. In this case, re-generate a public and private key pair, and reset the SSH keys for the same user with the newly generated public key, and update it. Let me know how it goes.

    Please refer to the screenshot below.

    181889-2022-03-10-19-07-06-clipboard.png


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.