Share via

Azure and SSH keys

h4yf 0 Reputation points
2023-08-01T21:07:10.0333333+00:00

Azure Virtual Machine

  • Standard DS1 v2 (1 vcpu, 3.5 GiB memory)
  • cat /etc/lsb_release = DISTRIB_DESCRIPTION="Ubuntu 20.04.6 LTS"
  • VM generation = V2

Using the ssh daemon I created and added SSH keys to my user's keychain and could access remote repo's over SSH just fine.

  • Start the agent
    eval "$(ssh-agent -s)"
  • Generate keys
    ssh-keygen -t ed25519-sk -C <comment>
  • Location
    /etc/ssh/<keyname>
  • Add keys
    ssh-add <keyname>

Nothing special

I recently resized my virtual machine (by accident, lab), but backed out of the process before it finished.

I noticed my /etc/ssh directory no longer has my SSH keys, where I had previously written them to.

I can regenerate keys no problem, I'm just confused as to where they went, or if this is something I did and is preventable.

Thanks

Azure Virtual Machines
Azure Virtual Machines

An Azure service that is used to provision Windows and Linux virtual machines.


1 answer

Sort by: Most helpful
  1. vipullag-MSFT 26,537 Reputation points Moderator
    2023-08-02T03:28:53.7333333+00:00

    Hello Jordan Sansing

    Welcome to Microsoft Q&A Platform, thanks for posting your query here.

    Usually resizing a virtual machine shouldn't delete any files from the filesystem, including SSH keys. However, there could have been an unintended issue during the resizing process that affected the VM's filesystem considering you have backed out the resize process before it finished.

    Resizing a virtual machine involves changes to its underlying hardware configuration, and such changes can sometimes lead to unexpected behaviors if interrupted before completion.

    Since you mentioned that you can regenerate the keys without any problem, I would recommend doing that and make sure to back them.

    If you want the exact root cause of loosing your keys, support team will be able to check and help on this. I would recommend you to open a azure support case.

    Hope this helps.

    Was this answer helpful?

    0 comments No comments

Your answer

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