HOW TO SSH INTO A LINUX VIRTUAL MACHINE, ENTER THE ROOT ENVIRONMENT, UPDATE IT AND CREATE DIRECTORIES OR FILES IN IT.
Tags: tutorial, linux, azure, microsoftcloud
Published: 2023-05-07 15:16:20

**Please check previous videos on how to create or deploy a linux virtual machine to get started.**

**STEP 1**
a. Click and open your virtual machine if you have created one. *Here, the name of my already created vm is "Mayworkload"
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8q8xk7wwdltvfhfpytrf.png)

**STEP 2**
a. Click on your public ip address to extend the "idle timeout" from 4 - 30minutes and save it.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qyjmxluoamd27esvfs88.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mrb0un7p3s5988bqbjqu.png)

**STEP 3**
a. Click on "overview" then click on "Connect"
b. Choose SSH, scroll down and copy no.4
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qg4zykuzb4lp9gy1eci3.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nhn9xahll6xpyw6550iw.png)

**STEP 4**
a. Open the terminal on your system
b. Paste the ip address you copied in your terminal,(please see diagram below) 
Follow this command arrangement to edit it. 
ssh username@ipaddress
c. You can also type in the command arrangement in 4b. directly to your terminal, then input your ipaddress seen in no.4 of step 3 in the ipaddress space.
Note* username here refers to the username you gave your administrator account when creating the virtual machine. When creating my vm,the administrator account name was azureuser. Please see the last diagram below to know what it should look like after editing.
d. Hit ENTER key
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u8qycb3iuy5p0ilt3kp4.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqiw07bx489gbom4xbg2.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6prwdjc1l5l2o0y02e9d.png)

**STEP 5**
a. The next space is asking for a password, enter the password you used for the administrator account. 
Note* Microsoft azure doesn’t show what you’re typing in when it comes to passwords so just type in your password in to the space.
b. Hit ENTER key and allow it to load.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ffn8ds2xnpa90gznw19k.png)

**STEP 6**
a. Type in the command Sudo su
b. Hit ENTER key
Note* Sudo su enables you into the root environment, you can download or update anything only when you’re in the root environment.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4tkzh5u229khuwuv09jz.png)

**STEP 7**
a. Type in command apt update
b. Hit ENTER key and wait for it to load.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzuvns4ofmogpkw1xzei.png)

**STEP 8**
a. Type in a file name already existing in your system that you want to create directory on by using the command mkdir then followed by the file name. E.g i have a folder with the name Grace , my command will be- mkdir Grace
Note* mkdir is used to create directory or subdirectories or other files, while directory is a place where you keep folders.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5grw2hstcl4ipmdehdb7.png)

**STEP 9**
a. Type in the command ls to list a directory or the contents of a directory.
Note* ls (list of files or subdirectories) as a command is used to list the content of a directory or file. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/celvratxx7zot8co661v.png)
b. You can go on to add more files as much as you want and also list them.

!!!!