<?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 EBIOU Moundzeli on Medium]]></title>
        <description><![CDATA[Stories by EBIOU Moundzeli on Medium]]></description>
        <link>https://medium.com/@Xavier-junior-EBIOU?source=rss-a4bb6fa59958------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*pN0eGNZOEMFVVBRkTobImQ.jpeg</url>
            <title>Stories by EBIOU Moundzeli on Medium</title>
            <link>https://medium.com/@Xavier-junior-EBIOU?source=rss-a4bb6fa59958------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 16:03:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Xavier-junior-EBIOU/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[Web-Based CLI Application: How to Configure and Execute Linux Commands on an AWS EC2 Server]]></title>
            <link>https://medium.com/@Xavier-junior-EBIOU/web-based-cli-application-how-to-configure-and-execute-linux-commands-on-an-aws-ec2-server-8d783b9991dc?source=rss-a4bb6fa59958------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d783b9991dc</guid>
            <category><![CDATA[systems-administration]]></category>
            <category><![CDATA[développement-web]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[EBIOU Moundzeli]]></dc:creator>
            <pubDate>Mon, 13 Jan 2025 13:30:52 GMT</pubDate>
            <atom:updated>2025-01-13T13:30:52.509Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>0. Explanation</strong></h3><p>We’ll use python and flask to create this Web-based CLI</p><h3>1. Log in to the AWS Management Console: Navigate to the EC2 Dashboard.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hah2N-j1B6PS0ABVsjf-JA.png" /></figure><h3>2. Launch an Instance:</h3><p>Name the instance;<br> Choose an Amazon Machine Image (AMI) such as Amazon Linux, Ubuntu, or Windows;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ueXdek-n204LZYFD2KqwZQ.png" /></figure><p>Create de key paire for ssh authentification, its dowloaded directly;</p><p>Leave the network settings by default;</p><p>Allow HTTP from the internet;</p><p>Click on launch instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lN6ypO7ZnDOO0DexF8Tfvg.png" /></figure><h3>3. Connect to EC2 using ssh</h3><p>In this Lab we use open ssh on linux as a ssh client.</p><p>Click on connect .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aaO9CeHZxoE1-ZokPC7tTg.png" /></figure><p>Copy the last link</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcT8Z9R7QTosDM9HZC66ng.png" /></figure><p>Give the rights to the key.</p><p>On your terminal write down :</p><pre>chmod 400 &quot;your key&quot;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gV_ienfaZm1_uHWnhzZQJw.png" /></figure><p>Past the link you copied</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ajFXbTik7v7HvODnT7dESA.png" /></figure><p>You are now connected .</p><h3>4.<strong> Install python and flask</strong></h3><p>Update the EC2</p><pre>sudo apt update<br>sudo apt upgrade</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BNbeceqpRClsv-w0F52ZHA.png" /></figure><p>Install python</p><pre>sudo apt install python3 python3-pip -y</pre><p>Check the installation</p><pre>python3 --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0lsQRO-MTpWByAAuceVwcg.png" /></figure><p>Install flask</p><pre>sudo apt install python3-flask</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AQ7ixbrukFLWVMPBJzo8WQ.png" /></figure><p>Create an application</p><pre>nano app.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DSP2qS6U6Ei67EunG-jNNg.png" /></figure><p>here is the code of our apllication</p><pre>from flask import Flask, render_template, request<br>import subprocess<br><br>app = Flask(__name__)<br><br>@app.route(&#39;/&#39;, methods=[&#39;GET&#39;, &#39;POST&#39;])<br>def index():<br>    result = &quot;&quot;<br>    if request.method == &#39;POST&#39;:<br>        command = request.form.get(&#39;command&#39;)  # Récupérer la commande saisie<br>        try:<br>            # Exécuter la commande et capturer la sortie<br>            result = subprocess.check_output(command, shell=True, stderr=subpro&gt;<br>        except subprocess.CalledProcessError as e:<br>            result = f&quot;Erreur lors de l&#39;exécution :\n{e.output}&quot;<br><br>    return render_template(&#39;index.html&#39;, result=result)<br><br>if __name__ == &#39;_main_&#39;:<br>    app.run(host=&#39;0.0.0.0&#39;, port=5000)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N6VPikVmhNWfxYKB1SDopg.png" /></figure><p>Create a directory named templete</p><pre> mkdir templet</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5b055NnrYgvC_wz5-gHpQA.png" /></figure><p>Create the file index.html ; Where the code of our page will be .</p><pre>nano templet/index.html</pre><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>    &lt;meta charset=&quot;UTF-8&quot;&gt;<br>    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;<br>    &lt;title&gt;Linux Command Executor&lt;/title&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;h1&gt;Linux Command Executor&lt;/h1&gt;<br>    &lt;form method=&quot;POST&quot;&gt;<br>        &lt;label for=&quot;command&quot;&gt;Entrez une commande Linux :&lt;/label&gt;&lt;br&gt;<br>        &lt;input type=&quot;text&quot; id=&quot;command&quot; name=&quot;command&quot; style=&quot;width: 400px;&quot; required&gt;<br>        &lt;button type=&quot;submit&quot;&gt;Exécuter&lt;/button&gt;<br>    &lt;/form&gt;<br>    &lt;hr&gt;<br>    {% if result %}<br>        &lt;h2&gt;Résultat :&lt;/h2&gt;<br>        &lt;pre&gt;{{ result }}&lt;/pre&gt;<br>    {% endif %}<br>    {% if error %}<br>        &lt;h2&gt;Erreur :&lt;/h2&gt;<br>        &lt;pre style=&quot;color: red;&quot;&gt;{{ error }}&lt;/pre&gt;<br>    {% endif %}<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5WvAstFdx1_OSTFlZVLpHA.png" /></figure><h3>5. Launch the web application</h3><pre>python3 app.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sSmrkLsewIq2sZff6eJNbw.png" /></figure><p>We have to open the port number 5000</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1pM7-An0Q7yUB3I_RHQ9VA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7q6hu4KJhoBBcpvEQnIVmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Psgknl4Ravr1BKN8A-mDA.png" /></figure><h3><strong>6. Test of the web_application</strong></h3><p>Go to a browser et write down : <a href="http://public_ip:5000/">http://public_ip:5000</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cmig8XDg-PZk-BeXxMRMJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TbJUXCNA9ExCSgO54ZIU8w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U4AtcAbUqctVJEhcRSNgJA.png" /></figure><h3>Thanks for viewing</h3><p>By<a href="https://medium.com/u/a4bb6fa59958"> EBIOU Xavier Junior</a> .</p><p><a href="https://medium.com/u/9047f985461a">Mbula Mboma Jean Gilbert</a> <a href="https://medium.com/u/c23f0c98ce94">Emmanuellabukasa</a> <a href="https://medium.com/u/a9f51dbcc445">Emeraude Makola</a> <a href="https://medium.com/u/77928ca7f0b4">Jerry Bangabiau Diwidi</a> <a href="https://medium.com/u/38cb030cc014">Jean-Paul Muzama Mulopo</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d783b9991dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>