Change ssh keys on Ubuntu Azure VM from Dashboard

I have an Ubuntu VM running on azure. I need to ssh to connect to it, but I lost my private key as my partition home

disappeared. So, I reinstalled the OS on my local machine and restored a new pf private / public key pair that I already use for github, bitbucket, ecc. Is there a way to install my new public key on an Ubuntu VM running Azure Portal?

+3


source to share


2 answers


Actually, there is.

  • you have to start your virtual machine first.
  • open a window for a virtual machine from the Azure portal
  • scroll down to reset password

  • choose reset SSH public key

    forMode

  • choose the right one user

  • paste the new public key into the box SSH public key

  • press the button UPDATE

    on top.


enter image description here

Just tested and works great for me.

+5


source


It depends on how you deploy your virtual machine using the Classic or Resource Manager deployment model .

Here is a snippet from How to reset Linux VM password or SSH key



You can also use the Azure portal to reset the password or SSH key of a Linux VM deployed in the classic deployment model. You cannot currently use the portal to do this for a Linux VM deployed in the Resource Manager Deployment Model.

If you are using Resource Manager, you can only do this via CLI or PS . Follow this link: Reset SSH Key

+2


source







All Articles