Linux Server Virtual Machines
- When we create a VM, the following resources get attached
- Instance size:
- number of vCPU
- RAM in GB
- Temp Disk Size
- Number of Data Disks
- Operating System: VM Image
- Credentials:
- User name and Password
- Username and Key
- Instance size:
- Lets create a key pair:
- Now lets create any linux (ubuntu)
-
To login into linux VM,
ssh -i <path to pem> username@publicip
& for the vm my ssh command isssh -i azuregenerated.pem azureuser@40.122.35.25
- Activity 1:
- Create a SSH Key and ensure you have pem file downloaded.
- Create a centos linux. username should be
azuredevops
. -
Login into centos linux using ssh command from your terminal and execute
sudo yum install tree -y
-
Activity 2:
- Lets create a key pair on our windows/mac laptops
ssh-keygen
press enter for all the prompts - in the home directory (
c:\users\<username> on windows and /home/username/
) .ssh folder will be created with 2 filesid_rsa and id_rsa.pub
- id_rsa.pub is the public file
- Lets import this ssh key
- Copy the contents of the id_rsa.pub
- Now create any linux and use the above imported ssh key
- Once the vm is created login using ssh command
ssh -i ~/.ssh/id_rsa <username>@<ipaddress>
- Lets create a key pair on our windows/mac laptops