Introduction to Linux: Start Your Learning Journey Today
This journey will guide you in learning Linux from basic to advanced levels, clarifying your concepts about Linux. The learning approach here emphasizes hands-on practice with less focus on theoretical aspects. Therefore, I recommend having a Linux system ready so you can start exploring Linux immediately.
There are certain way you can use and configure your Linux Machine, Like VM on existing Device or any Cloud VM with some of the famous cloud providers like Amazon AWS, Microsoft Azure and GCP.
I will share one quick way to configure a Linux VM on Google Cloud, There are various article available for other ways and you can easily search for it on google.
Day1: Setup your Device.
Step 1. First go to the google cloud and generate SSH Key. (For which Purpose we learn it later) https://cloud.google.com/compute/docs/connect/create-ssh-keys
Step2: Install Git for windows in your windows machine
Step3: Once git is Installed Paste the SSH Key which you have generated from the Keygen.
Example my user name is cent os and i gave my vm name linlab ssh-keygen -t rsa -f ~/.ssh/linlab -C
Step:4 Once you paste the above ssh key in github it will ask you to enter passphrase , press enter (we are not using anything for now) Enter again and the key got generated something like this.
Once it's generated please go the directory where these ssh file is stored type cd .ssh Once you're in the directory please type ls You can able to see the linlab and linlab.pub file over there . Open linlab.pub file with cat linlab.pub
Setting up instance on Google Cloud.
Step6 :
Create instance Select any VM size and type based on Linux OS requirement. Here we are choosing cent OS and choosing 20GB disk space and e2-medium machine type . Go to firewall/Network Section and select HTTP and HTTPS traffic ON.
Step7 : go to Security and select for enter SSH Key .Paste the SSH Key which you have copied from linlab.pub file. Once done, please click on Create.
Step 8: Once you’re able to view the VM on google cloud compute section kindly go to your github terminal and go to SSH directory , if you want to check under which directory you’re in right now please use pwd command to check.
Step 9: To move to the ssh directory please use cd /user/._ssh(your username instad of user)
now type chmod 400 sshkey name.
For Ex: chmod 400 linlab
Now please use ssh -i keyname username@ipaddress to connect the VM. (please use WAN IF of your VM)
For Ex: ssh -i linlab centos@xx.xx.xx.xx
Please make sure you’re in .ssh directory when trying to connect it through Github else it will not work because it will consider your current location as ssh directory and where no key has been identified.
Note:
I am sure you must have lot of questions regarding what is this key, why we need to generate it ? What’s use of Pub File, I will explain everything in details in upcoming section, as we are just setting up our linux machine here so you can get a hand with the Linux flavor. Also Here, in Windows we call it folder and in Linux it’s called Directory. so you may see these word many times in future .