Azure Linux VM’s Continued
Activity 1: Create an ubuntu linux VM
- Create an ubuntu linux vm and install the following softwares
- apache
- php
- stress
sudo apt update
sudo apt install apache2 -y
sudo apt install php libapache2-mod-php php-mysql -y
sudo apt install stress -y
echo '<?php phpinfo(); ?>' > info.php
sudo cp info.php /var/www/html/info.php
# create a file in
#<?php phpinfo(); ?>
- While creating VM open 22, 80 ports
- Ensure you use the key imported (your id_rsa)
- Ensure the username matches your laptops username
- Solution
- Create a ubuntu 20.04 VM, Enter user name (Dell) and select public key stored in azure.
- Once the VM is created.
- Approach 1:
- ssh into the vm and execute the above commands
- Access
http://publicip/info.php
- Approach 2: Lets use Run Command from Operations blade
- Screen shot
- Lets select shell script
- Screen shot
- When we use Approach 2, azure will interact with the agent present on the linux vm.
- Note: Try resetting the ssh password or key using the help blade => Reset password from Azure VM
