If for some reason you cannot SSH into your VM using your
Linux admin user (e.g.
azureuser), you can reset your
credentials via the Azure Portal.
Reset your credentials with the
Reset Password tool
Reset Password tool in the Azure Portal lets you update the credentials of Linux admin users,
as well as create new users.
Under the VM details page, go to Reset password.
This page gives you the option to reset your password or SSH public key.
You can also create a new Linux admin user, as long as you specify a new username.
Note: Be careful not to select
Reset configuration only, because this will
wipe out the SFTP Gateway specific settings in the
Reset Password tool is not working properly, there are a couple of things you can check.
Reset Password feature in the Azure Portal relies on the pre-installed
enablevmaccess Linux extension. However, this extension requires Python, which may not be configured properly on earlier versions of SFTP Gateway 3.x.
In this section, you will verify whether Python is installed, and install it if necessary.
In the VM details page, open the Run Command tab from the left side menu.
RunShellScript. This opens a modal that lets you submit Bash commands.
Type in the following command:
It will take a minute or two for the script to execute.
If you see the Python version (e.g.
Python 3.6.8) in the standard output (i.e.
[stdout]), you can skip
to the next section.
Otherwise, run the following commands:
dnf install python3 rm -f /usr/bin/python3 alternatives --set python3 /usr/bin/python3.6 alternatives --set python /usr/bin/python3
These commands install Python 3 on the VM. You should see the following output:
Once Python is installed, return to the VM Overview page, and Restart the VM.
Reset Password tool will not work until this Restart has taken place.
To check your disk space, use the Run Command utility in the Azure Portal to run this command:
If the root partition is full, the Linux agent will not be able to perform the necessary commands to reset credentials. If this is the case, you will need to poke around the file system and find files (e.g. large log files in
/var/log/) to delete in order to free up some space.