How to reset SSH configuration on a Azure Machine Learning VM?

Leo 20 Reputation points
2025-06-19T09:41:01.33+00:00

For some unknown reason, and out of the blue, I can no longer access my Azure Machine Learning VMs via SSH (connection refused). The most reasonable step forward is to reset the SSH configuration. I cannot find a way to reset the configuration. For a "normal VM" this action is trivial and can be done under Support + Troubleshooting -> Reset Password. On the Machine Learning VM, the reset password does not seem to exist. Does anyone has any idea how to reset the config or how to solve this issue?

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. Aslam Mohammad 400 Reputation points Microsoft External Staff Moderator
    2025-06-23T13:53:31.48+00:00

    Hi Leo

    Boot diagnostics, serial console, and password reset are not available for AML compute instances.

    Go to the Azure Machine Learning workspace in the Azure portal.

    Navigate to Compute > Compute instances.

    If the VM is unresponsive or fails to start, try stopping and restarting it from the portal.

    If issues persist, consider deleting and recreating the compute instance after backing up any important data

    If you have any further queries, let me know. If the information is helpful, please click on Upvote.

    Thank you.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Alex Burlachenko 9,780 Reputation points
    2025-06-19T14:53:55.5733333+00:00

    Hi Leo, the process is a bit different than regular vms but still manageable. Try using the azure portal to reset ssh directly. go to your vm's overview page and look for the 'serial console' option under support + troubleshooting. if u get lucky, u might just get a login prompt right there. https://docs.microsoft.com/en-us/azure/virtual-machines/troubleshooting/serial-console-linux.

    if that doesn't work, no sweat )) u can still reset ssh config through the azure cli. run this command after installing the cli: az vm user update --resource-group your_rg_name --name your_vm_name --username your_username --ssh-key-value "$(cat ~/.ssh/id_rsa.pub)"

    MSFT official way to do it https://docs.microsoft.com/en-us/azure/virtual-machines/linux/create-ssh-keys-detailed. just be sure u have contributor access to the vm or this won't fly.

    If u're locked out completely, check if u can access the vm's os disk. mount it to another vm as a data disk and edit the ssh config files manually. this is the nuclear option but hey, it works on any cloud platform )) just find User's image on the mounted disk and set 'passwordauthentication yes' temporarily. microsoft has a cool guide for disk mounting https://docs.microsoft.com/en-us/azure/virtual-machines/linux/troubleshoot-recovery-disks.

    worth poking around the network security groups. sometimes azure ml vms get funky with their inbound rules. make sure port 22 is open in both the nsg and the vm's own firewall. this might help in other tools too when ssh acts up.

    funny how ssh can just decide to take a vacation, lol hope this gets u sorted. and thanks for bringing this up on q&a - these questions help to everyone ...

    rgds,

    Alex


  2. Leo 20 Reputation points
    2025-06-23T13:58:42.5766667+00:00

    Boot diagnostics, serial console, and password reset are not available for Machine Learning compute instances.

    The only way to use the machine is to delete it and create a new one.

    0 comments No comments

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.