Error when Create a Linux virtual machine and install Nginx: sudo: "If sudo is running in a container, you may need to adjust the container configuration to disable the flag". What to do?

Angela Paternina 20 Reputation points
2024-09-11T12:35:50.9266667+00:00

Error when Create a Linux virtual machine and install Nginx: sudo: "If sudo is running in a container, you may need to adjust the container configuration to disable the flag". What to do?

User's image

This question is related to the following Learning Module

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

Accepted answer
  1. VarunTha 9,655 Reputation points Microsoft Vendor
    2024-09-11T15:55:42.9466667+00:00

    Hi Angela Paternina,
    Thank you for reaching out to us on the Microsoft Q&A forum.

    Sorry for the inconvenience. Let's address your issue step by step:

    1. Public Address Observation: Upon executing step 1, you should see a public address like this: 40.112.149.7. This confirms that the initial step has been successfully completed.
    2. Continuation to Step 2: Please proceed by copying the public IP address and executing step 2. User's image
    3. SSH Command Execution: After completing step 2, enter the following command in your terminal or command prompt: ssh azureuser@<VM public IP address> (e.g., ssh azureuser@40.112.149.7). When prompted with a message asking if you want to continue connecting, type "yes" (without quotes) and press Enter to proceed. User's image
    4. Cloud Shell Commands: Once connected via SSH, run the following commands sequentially in your cloud shell:
    • 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

    User's image

    After executing the commands, check if the issue persists. If you encounter a password prompt or any difficulties, share the specific error message or behavior. I'm here to assist further and can provide additional troubleshooting or resources if needed.

    If you have found the answer provided to be helpful, please click on the "Upvote and Accept Answer" button so that it is useful for other members in the Microsoft Q&A community.

    2 people found this answer helpful.

0 additional answers

Sort by: Most 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.