Boot menu ads. Step 3: In kernel configuration, we have 2 methods to change to single mode. 1 we can use a number “1″, 2 we can use character “S”. Enter after done. Step 4: Change your root password. Simply enter the “passwd” command to change your root password. Enter, then re-enter your new password when prompted. When done, just reboot your system by using the “reboot” or “exit” command. If it hangs/freezes on this screen, just reset your machine. How to change the root password on Fedora.
I have a CentOS 6.9 vm on azure, it was created from a vhd disk that was uploaded.The root account has been blocked because of failed login attemps.So i wonder if there is a way to reset the root account password?
I've tried the steps of this post:https://serverfault.com/questions/680460/how-to-reset-root-password-on-a-linux-vm-on-windows-azure?newreg=5d2142cb59ba400a9def39ad7245fc74
But the Azure Cli stucks at Installing extension 'VMAccessForLinux', VM: 'API-GW'
Any ideas on how to solve this?
2 Answers
If you have access to the Azure portal, select the VM, one the left hand menu under 'support + troubleshooting' is an option to reset password, ssh key, or to create a new user with sudo access.
As I see, you create the Azure VM from a vhd disk which you uploaded. So there is a point if you install the agent in the vhd disk when you create the vhd disk, this is what you should check. If not, you could not interact with the Azure VM.
If you install the agent, there are serial ways to reset the password for your account following the document Manage administrative users, SSH, and check or repair disks on Linux VMs using the VMAccess Extension with the Azure CLI 2.0.
You also can reset the password in Azure Portal. In the VM dashboard, you can find the Reset password in left, just like the screenshot below: