<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tangang Maxwell  on Medium]]></title>
        <description><![CDATA[Stories by Tangang Maxwell  on Medium]]></description>
        <link>https://medium.com/@pretymax25?source=rss-7e9478ea15ec------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dmbNkD5D-u45r44go_cf0g.png</url>
            <title>Stories by Tangang Maxwell  on Medium</title>
            <link>https://medium.com/@pretymax25?source=rss-7e9478ea15ec------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 05:19:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pretymax25/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[DevOps Project 1: Linux Administration]]></title>
            <link>https://medium.com/@pretymax25/devops-project-1-linux-administration-cb053243cb72?source=rss-7e9478ea15ec------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb053243cb72</guid>
            <dc:creator><![CDATA[Tangang Maxwell ]]></dc:creator>
            <pubDate>Tue, 20 Aug 2024 21:52:06 GMT</pubDate>
            <atom:updated>2024-08-20T21:52:06.506Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wCz6RW1V-D-TLPT-0YNfkw.gif" /><figcaption><strong>Prototype Demonstration</strong></figcaption></figure><p><strong>A. Project Overview</strong></p><p>Linux administration on Amazon EC2 instances is a fundamental skill for managing and maintaining servers in the cloud. In this blog, we’ll delve into the power of infrastructure as code using Terraform, the essentials of Linux administration on an EC2 instance, covering key tasks, best practices, and powerful tools that help streamline server management and optimize performance.</p><p><strong>Project prerequisite</strong></p><ol><li><a href="https://aws.amazon.com/console/">An AWS Account</a></li><li><a href="https://code.visualstudio.com/download">Download and install Visual Studio code</a></li><li><a href="https://git-scm.com/download/win">Download and install Git</a></li><li><a href="https://linuxjourney.com/lesson/the-shell">Basic understanding of Linux commands and terminal usage.</a></li></ol><p><strong>B. Project architecture</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*mkDqdNNGRwD0N7HBhy9VDQ.png" /></figure><p><strong>C. Step-by-step Guide on How to Deploy, Connect, and Execute commands on a Linux Web server.</strong></p><p>In this project, we will be embarking on an exciting journey of infrastructure deployment using Terraform. Our objective is to utilize Terraform to orchestrate the deployment of our cloud infrastructure, establish connectivity to a Linux web server via SSH, and execute essential Linux commands. The utilization of Terraform’s infrastructure-as-code approach empowers us to define and manage our infrastructure in a version-controlled and efficient manner. We’re poised to codify our infrastructure requirements through Terraform, ensuring consistency, scalability, and repeatable provisioning.</p><p><strong>Project Work Through</strong></p><p>1. Create a key pair</p><p>2. Deploy Terraform template</p><p>3. SSH to the Linux Web server</p><p>4. Run commands on the Linux Web server</p><p>5. Delete Resources</p><p><strong>Cost Estimate</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/723/1*ASHEhtZr_DaXZ2uAQJL5cg.png" /></figure><p><strong>Total cost range per hour = $0.0188-$0.05</strong></p><p><strong>Step I: Create a key pair.</strong></p><p>1. Sign into the AWS Management Console and click on services at the top left corner of your screen, then click on compute in the drop down menu and on EC2 to the right.</p><p>2. In the EC2 console move to the navigation pane and Click on <strong>Key Pairs</strong> in the Network &amp; Security section. This will display the key pair page as seen below. Then click on the <strong>Create key pai</strong>r button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AQwdvJ-NsE9V6tVw6arhYg.png" /></figure><p>3. Fill in the required information <strong>(</strong>the name of the key pair which in my case is<strong> “linux-keypair”</strong> Proceed down to the <strong>key pair type</strong> and select “<strong>RSA</strong>”. For private key file format select “<strong>.pem</strong>” and finally Click the “<strong>Create Key Pair</strong>” button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAgLDVc3PWTy9KvQy88QMQ.png" /></figure><p>4. The page will download the “linux-keypair” file to the local drive. Follow the browser instructions to save the file to the default download location. Remember the full path to the key pair file you just downloaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uru3M4RwrRJnByjx8JCdFA.png" /></figure><p><strong>Step II: Deploy the Terraform template.</strong></p><ol><li>Open Visual Studio code, click on the 3 dots near selection and choose terminal on the drop-down menu. Under terminal click on new terminal. Clone the lab repository to your working directory by running this command on the terminal.</li></ol><pre>git clone https://github.com/VonMax25/LinuxEC2Templ.git</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v4Frq0e3KeHPJ5ZaOOGRPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0SX2ly4YansUyHuN_sid7w.png" /></figure><p>2. To open the cloned directory on VS code, move to files at the top left of your VS code, on the drop-down menu select open folder and move through the pathway for your folder (in my case it’s in the local drive C:\Users\VonMax Digital) and select LinuxEC2Templ as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cwkTv9hTQTlKTy9_LkAYfQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/941/1*i9O2CLJJ-R6j_HqhUwaAoA.png" /></figure><p>3. In VS code select the LinuxEC2Template.tf file under the LinuxEC2Template as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NhnZw2g3RvKR4Te-HTIusQ.png" /></figure><p>4. Please update the AMI on line 117 of the LinuxEC2Template.tf file with your own. To locate your AMI, go to the AWS console and ensure you are in the N. Virginia (us-east-1) region. On the search bar type EC2 and select EC2 from the drop-down menu. In the EC2 console move the navigation pane and select instances. In the instance page click on Create instance, In the “Create Instance” page, scroll down to the “Application and OS Images” section. Copy and paste the AMI in line 117 as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cViqwe0qaQtGQWeI-zIX_A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5LlBYrH4Kqdtauc3wjjZA.png" /></figure><p>5. If you have named your key pair the same as mine, then you do not need to perform this step. However, if you have given your key pair a different name, you will need to update line 120 of the template with the name of your key pair. Once you have made the necessary update, save the document by pressing the combination of keys “ctrl + S”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jcH5F-O7l3iZdzxpxoLgKA.png" /></figure><p>6. To deploy the Terraform template, click on the three dots near Selection and choose Terminal. Under Terminal, click on New Terminal and run the following command in the terminal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7dllrxnjyLQ28wOgOk-MZQ.png" /></figure><pre>terraform init </pre><p>The “<strong>terraform init</strong>” initializes a working directory and downloads the necessary provider plugins and modules and sets up the back-end for storing your infrastructure’s state.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xEn3G_Ilgq6Tb3eKkfjcfA.png" /></figure><pre>terraform plan </pre><p>The terraform plan command outlines the resources to be deployed. In our template, the terraform plan outlines nine resources to be created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ImV3RWPpOpiQ2ozwiuhHXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GuDxajCJkOA1nJeobVqIQw.png" /></figure><pre>terraform apply </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LoVA8hI5ylr46Ua0NGe6NA.png" /></figure><p>Once you type ‘terraform apply’ and hit enter, you’ll be prompted to confirm the action by typing ‘yes’ and hitting enter. Wait for the resource to be created, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wjFe-6JdaUBtB4NSN-bJNQ.png" /></figure><p>7. Go back to the AWS console, ensure that you are in N. Virginia(us-east-1), and On the search bar type EC2, in the drop-down menu select EC2. In the EC2 console move to the navigation pane, click on instances, and verify if the instance and other resources have been created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d5tSkM_bZJcnUG_f1sVg_Q.png" /></figure><p><strong>Step III: SSH to the Linux Web server.</strong></p><ol><li>To connect to the Linux web server, select the instance created, and click on the Connect button in the EC2 console as shown below.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eU925Xr-uysOfboBeavlLA.png" /></figure><p>2. In the <strong>Connect to Instance</strong> page, select the SSH Client tab, and under Example, copy the command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I2JKQvy1af7QEhtueFhD6A.png" /></figure><p>3. Open Window power shell, command prompt or git bash terminal (in this case, I am using git bash). Change the directory to Downloads (in this case Desktop/Keypairs) where the key pair is located by running this command <strong>cd Keypairs</strong>, (or <strong>cd Downloads</strong> if your key pair is located in the downloads directory) then paste the command you had copied from the <strong>Connect to instance</strong> page and press enter. Then a confirmation message will appear in which you type “<strong>yes”</strong> to connect to the Linux instance as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/917/1*aNLPaPG-bHT94izq9JSUkw.png" /></figure><p><strong>Step IV: Run commands on the Linux Web server</strong></p><ol><li>To list all files, including hidden files, on a Linux web server, execute this command.</li></ol><pre>ls -a </pre><p>2. Create a directory called <strong>“mydirectory” </strong>and move into the directory by executing the commands below</p><pre>mkdir mydirectory<br>ls</pre><pre>cd mydirectory</pre><p>3. Create 20 files with the name ‘<strong>file</strong>’ by using this command <strong>“touch file{1..20}</strong>” and copy file 10 to file 20 into the user’s home directory by running this command <strong>“cp file{10..20}”.</strong></p><pre>touch file{1..20}<br>ls</pre><pre>cp file{10..20} ~<br>cd ~<br>ls</pre><p>4. Rename file10 as track10 by running “mv file10 track10”. Delete files 11–20 by running “rm file{11..20}”</p><pre>mv file10 track10 <br>ls</pre><pre>rm file{11..20}<br>ls</pre><p>5. To remove the mydirectory that contains many files, run this command.</p><pre>rm -r mydirectory <br>ls </pre><p>6. To remove the file named track10, we run the command</p><pre>rm track10 <br>ls</pre><p>7. Lastly, after making changes on your Linux web server, exit it by running the command below</p><pre>logout</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*f3gKfg3B7zI0Ftq0vZ919A.png" /></figure><p><strong>Step V: Delete Resources</strong></p><ol><li>To delete the resource created from the Terraform template, go to VS Code and type the following command in the terminal</li></ol><pre>terraform destroy </pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ch6uemhogsjkYoJBVc4Nvw.png" /></figure><p>2. When the confirmation message pops up type in <strong>“yes”</strong> to proceed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yB7TNWIOHKGh37TSVEf1fg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dkC-LUDdb-0e1_FJbdeV1w.png" /></figure><p>3. Check to see if the resources have been deleted from your account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9lO8gMb6uboS6pgkXn9hNw.png" /></figure><p>Thank you for reading to the end. To stay updated with my weekly blogs, please subscribe to the newsletter and connect with me on LinkedIn <a href="http://www.linkedin.com/in/tangang-maxwell">www.linkedin.com/in/tangang-maxwell</a></p><h4><strong>Project Collaborators:</strong></h4><ol><li><a href="https://www.linkedin.com/in/tangang-maxwell-21012b141/"><strong>Tangang N. N. Maxwell</strong></a></li><li><a href="https://www.linkedin.com/in/flora-yuyuun-3a98b2214"><strong>Flora Yuyuun</strong></a></li><li><a href="https://www.linkedin.com/in/tunteng-vanisa-b1180919b?lipi=urn%3Ali%3Apage%3Ad_flagship3_profile_view_base_contact_details%3BKSl%2F3xH3SheBuC24bBUMRg%3D%3D"><strong>Tunteng Vanisa</strong></a></li><li><a href="http://www.linkedin.com/in/yunika-giles"><strong>Yunika Giles Abidezugho</strong></a></li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb053243cb72" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>