Sudo password for azure sandbox

Irvine Mosha 40 Reputation points
2023-01-19T15:00:59.1866667+00:00

Greetings,

I was going through the azure fundamental in Microsoft learn and in unit 3 task 1 step 2 it explains to us to update our vm so as to install Nginx but doing so through Sudo apt-get update it prompts a Sudo password in which I didn't create any password on the creation of the vm, so can you help me resolve the issue or guide me on how to resolve it.

Thanks, i have attached a snapshot of the issue am facing.User's image

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.
973 questions
0 comments No comments
{count} votes

Accepted answer
  1. TP 77,076 Reputation points
    2023-01-19T15:34:20.9366667+00:00

    Hi,

    You need to ssh to the vm you created before you can use sudo. Please see instructions below to complete the exercise.

    Please activate new sandbox and create the VM as instructed in the exercise. After Task 1 finishes, make a note of the publicIpAddress that was assigned to the VM (e.g. 20.245.72.52). Start Task 2, and then when it errors out, follow steps below:

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

    ssh azureuser@<VM public ip address>

    Enter yes when you are prompted.

    Copy and right-click -- paste the following three commands below in the cloud shell window. Wait for each to complete before pasting in the next command.

    sudo apt-get update
    
    sudo apt-get install -y nginx
    
    echo "<html><body><h2>Welcome to Azure! My name is $(hostname).</h2></body></html>" | sudo tee -a /var/www/html/index.html
    

    Performing the steps above should only add a couple of minutes to the process. Continue on in the module. If you have any questions please let me know in a comment.

    If this was helpful to you please Accept Answer.

    Thanks.

    -TP

    16 people found this answer helpful.

4 additional answers

Sort by: Most helpful
  1. Huzaifa Tanzeel 105 Reputation points Student Ambassador
    2023-03-18T13:23:53.28+00:00

    Initially running the following, note down the highlighted public ip address then proceed till sudo apt-get update and when password is not matched , type ssh azureuser@publicipaddress , substitute your public ip address noted above then press enter -> Type yes -> sudo apt-get update ->....errorfind

    errorfind2

    11 people found this answer helpful.
    0 comments No comments

  2. Manu Philip 16,991 Reputation points MVP
    2023-01-19T15:09:59.7933333+00:00

    Setting sudo permission is not permitted in AZURE sandbox by design. Basically, any installation outside your $Home directory isn't persisted in sandbox and sudo need Permissions outside $Home directory.

    More derails are here


    --please don't forget to upvote and Accept as answer if the reply is helpful--

    4 people found this answer helpful.

  3. Irvine Mosha 40 Reputation points
    2023-01-20T07:49:18.58+00:00

    Greetings TP

    still facing error can you illustrate if it's possible on how to resolve the issue. I have also attached a snapshot of the sandbox below.

    User's image

    As you can see when i try to implement ssh azureuser it shows error as hostname not known. will be glad about the assist.

    thanks, regards,

    Irvine


  4. Jesus Luongo 0 Reputation points
    2023-11-20T04:32:11.34+00:00

    hello I have the same issue any idea?