how to find the password

Muthu Kumar T 0 Reputation points
2024-01-02T17:17:54.3766667+00:00

here i created a vm by using cloud shell commands but there is no password for that how i can get that

Azure Training
Azure Training
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Training: Instruction to develop new skills.
2,019 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Azar 26,180 Reputation points MVP
    2024-01-02T18:02:31.23+00:00

    Hi Muthu Kumar T

    I guess azure doesn't provide the password in plain text after VM creation. Instead, you set the password during the VM creation process.

    you can reset it using Azure CLI.

    Resetting Password for Windows VM using Azure CLI:

    Open Azure Cloud Shell.

    Use the following command to reset the password:

    az vm reset-access --name your_vm_name --resource-group your_resource_group --admin-password new_password
    
    
    

    Replace your_vm_name with the name of your VM and your_resource_group with the name of your resource group. Also, replace new_password with the new password you want to set.

    Thats it you will be able to login with the new credentials now

    If this helps, kindly accept the answer thanks much

    1 person found this answer helpful.
    0 comments No comments

  2. Dillon Silzer 57,616 Reputation points
    2024-01-04T06:28:05.2433333+00:00

    Hello,

    You can also do this through the Azure Portal.

    Go to your Resource Group > Azure Virtual Machine > Support + troubleshooting > Reset password.

    User's image


    If this is helpful please accept answer.

    0 comments No comments

  3. pnaroju 3,145 Reputation points Microsoft Vendor
    2024-01-03T07:05:46.3833333+00:00

    Hi Muthu Kumar T,

    Thank you for reaching out to us on Microsoft Q&A forum.

    Based on my understanding of the issue, you are practicing the following Learn path exercise.

    Subject : Microsoft Certified-Azure Fundamentals

    Learning Path : Microsoft Azure Fundamentals: Describe Azure architecture and services.

    Module : Describe Azure compute and networking services

    Unit 3 of 14 : Exercise - Create an Azure virtual machine.

    In Azure, when we create a Linux virtual machine (VM), we typically use SSH key pairs for authentication rather than a password.

    In the Exercise - Create an Azure virtual machine under Task 1: Create a Linux virtual machine and install Nginx we have two steps:

    Step 1: To create a Linux VM using "az vm create" command and

    Step 2: To configure Nginx on the VM created using "az vm extension set" command.

    As mentioned in the exercise, we have used generate-ssh-keys for authentication while creating the VM using "az vm create" command rather than a password.

    The "az vm extension set" command uses the Custom Script Extension to run a Bash script on your VM to configure Nginx.

    We can successfully create a Linux VM and configure Nginx on the VM created by following the above steps of Task 1 and complete the exercise without any password. Kindly find the screenshots attached for reference.

    CS1

    CS2

    We don’t have to manually run the command "sudo apt-get update" separately. The Custom Script Extension used in "az vm extension set" command to run a Bash script takes care of invoking "sudo apt-get update" automatically with elevated permissions. By running the script, the command automatically runs 'sudo apt-get update' with the saved SSH key files.

    If we manually run the command "sudo apt-get update"(not required as per the exercise), the system prompts us to enter a password.

    CS3

    As we have used SSH key pairs for authentication rather than a password, we cannot enter a password.

    If we want to connect to the VM created (without a password in this case for Linux VM) we need to do ssh to the vm created, before we can use sudo.

    After completing Step 1, create a Linux VM of Task 1, make a note of the publicIpAddress that was assigned to the VM (for example:20.66.97.117).

    Connect to the newly created VM using ssh (in cloud shell). We need to substitute the publicIpAddress noted above for <VM public ip address> in the command below:

    "ssh azureuser@<VM public ip address>"

    Enter 'yes' when you are prompted.

    CS4

    Now we have successfully connected to the VM without using password and we can work in the VM. We can see our VM name as "my-vm" in the screenshot below which is same as given in "az vm create" command.

    CS5

    If we want to exit from the VM and come into CLI screen we use "exit" command.

    CS6

    If you are still running into issues,kindly attach the screenshots for reference and please let us know in the comments.We are glad to help you.

    If the answer has been helpful in resolving the issue, please consider accepting the answer by clicking on "Upvote" and "Accept answer" button to help increase visibility of this question for other members of the Microsoft Q&A community.

    Thank you.

    1 person found this answer helpful.

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.