HOW TO CREATE A LINUX MACHINE WITH SSH PUBLIC KEY
Published: 2024-04-12 22:47:20

A Linux virtual machine (VM) is an additive process that starts with selecting a Linux distribution and obtaining Linux kernel and RAM disk images, and ends with instantiating and running the Linux VM on the user's computer.It basically involved the use of command line to achieve one desired  purpose.
STEPS TO CREATE A LINUX VIRTUAL MACHINE
a.Click on virtual machine on azure portal

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkfs1mudpcpt6k589eox.png)
b. Select your subscription and create a suitable  resource group name to the linux virtual machine  by clicking create

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x6p6w92c07ddpzlx3z5j.png)
c Give suitable name for your linux virtual machine
d. select a region for the machine
e. Pick a desired availability  zone for the linux virtual machine

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fgugo4bv8nlcanwr6a5s.png)
f. For Image, Select Unbuntu server
NB: the type of image you select will determine kind of virtual machine that will be created for you in azure.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/g15iajoxkat1ntauo3on.png)
g. size will be selected for the machine by default. This can be change if needed.
 Administrator Account
h. For Authentication type click connect with ssh public key

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gebj6rs7bnsg07jnkl6t.png)

i. Input the the username you which to use to connect the machine
j. Under ssh public key source: click  Generate new key pair.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8yva41brdmqshdc8zge7.png) 
k. click next to select the disk size 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/396pq1o5k9vy63iv2rga.png)
l. click next will you reach review and create
click on review and create
 A page will showed up requesting you to generate new key pair
click downloads private key and go to resource

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u0trallrk2lc7l1utobi.png)
NB; A deployment page will be initiated for you until it become successful.
**HOW TO CONNECT THE LINUX VIRTUAL MACHINE**
a. Go to resource on the virtual machine page
b. click on connect
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zwd1nf7uiv9gr8vd0y0f.png)
c. Copy the Username and IP to a save place such as notepad.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/arwkam03sk00oectfu95.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9w5ahme4oro52r2rmdjs.png)
d. Open window Powershell

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k3qg4m7t5e6ztb8q3uds.png)
e. Enter the command below into your powershell

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rmpreww56xzeqbcfind5.jpg)
f. You will be asked if you want to connect click yes then enter

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/56xihao4sjn77qky7rcw.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2nj5fnjxoopkls50zn8f.png)