vm password reset

arun kumar 71 Reputation points
2021-08-06T16:11:14.19+00:00

Hi..,

i had changed ssh key option to password option for the linux vm by using password reset option in azure portal. now both my password option and ssh option is working for login to the linux vm.

need to eliminate password option to login vm. please help me with the process to resolve the issue.

also please let me know the path where actually the password will be saved in linux vm. i know ssh key will be stored in the path ~ /.ssh/authorization_keys but dont know about the password where it will be saved in linux vm.

if i know the path then i can open that file and will remove the entry in that file.

thanks and regards
Aeun C V

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,585 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Dominik Dudczak 176 Reputation points
    2021-08-06T18:46:12.917+00:00

    Hey there @arun kumar , As for your second question: I am not a Linux expert but in unix passwords were originally stored in /etc/passwd and then moved to /etc/shadow (with a backup in /etc/shadow-). I am not sure if Azure stores the passwords in the same location but I would assume so. Regarding your first question: I have never faced that issue since I am only using SSH to login to my machines. However, you could download the ARM Template of that machine: - Inside the Azure Portal, go to your VM - Go onto "Export Template": ![121200-image.png][1] - Download the Template - Change the parameter "disablePasswordAuthentication" to "true" and save the template. (You can find the parameter under "linuxConfiguration", just search inside the Json file). - Redeploy the template into the Resource Group where your VM is. More information on ARM templates and deploying them: ARM templates overview: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/ How to deploy local arm templates: https://learn.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-tutorial-local-template?tabs=azure-powershell Important: Make sure to do an incremental deployment and not a complete deployment when redeploying the VM. Using the complete deployment, you risk deleting other resources inside that resource group. Hope I could help Kind Regards Dominik [1]: /api/attachments/121200-image.png?platform=QnA

    1 person found this answer helpful.
    0 comments No comments