<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Md. Abdul Halim Rafi</title>
    <description>The latest articles on DEV Community by Md. Abdul Halim Rafi (@mdabdulhalimrafi).</description>
    <link>https://dev.to/mdabdulhalimrafi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F373805%2F75bd7dec-5031-47aa-bb0e-9aab9762e0f2.jpeg</url>
      <title>DEV Community: Md. Abdul Halim Rafi</title>
      <link>https://dev.to/mdabdulhalimrafi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mdabdulhalimrafi"/>
    <language>en</language>
    <item>
      <title>How to add AWS EC2 instance root user password (Simpliest way!)</title>
      <dc:creator>Md. Abdul Halim Rafi</dc:creator>
      <pubDate>Tue, 18 May 2021 12:24:29 +0000</pubDate>
      <link>https://dev.to/mdabdulhalimrafi/how-to-add-aws-ec2-instance-root-user-password-simpliest-way-1997</link>
      <guid>https://dev.to/mdabdulhalimrafi/how-to-add-aws-ec2-instance-root-user-password-simpliest-way-1997</guid>
      <description>&lt;p&gt;When we create an instance in AWS EC2, we need to add a &lt;code&gt;.pem&lt;/code&gt; file to the instance. And to log in every time we need to use that .pem file to our local machine. Which is not that cool way :(&lt;/p&gt;

&lt;p&gt;So, in this article, we will learn how we can add root user password for ssh login from our local machine to AWS EC2 instance.&lt;/p&gt;

&lt;p&gt;Before getting started, I am considering we have a running instance on AWS EC2. I am running the ubuntu operating system on my instance. For the Linux instance, all these work the same as the ubuntu instance.&lt;/p&gt;

&lt;p&gt;At first, we need to log in to our instance with the corresponding .pem file by the following command and of course, replace “your-pem-file.pem” by your instance .pem file and x.x.x.x by your instance IP address:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh -i "your-pem-file.pem" ubuntu@x.x.x.x&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then, we need to switch to superuser by running this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo su&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After that, we will edit the configuration to modify the ssh login system for password. So, let’s open the configuration file with a nano editor. This will let us edit the default configuration.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;nano /etc/ssh/sshd_config&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;This will open the config file which possibly will look like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fxaMu5wL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqypcholsnjh4qfv7oth.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fxaMu5wL--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dqypcholsnjh4qfv7oth.png" alt="sshd-config-file"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, we need to tell ssh we want password authentication. For this, we are going to change PasswordAuthentication no&lt;code&gt;to PasswordAuthentication yes&lt;/code&gt;. After that, press crtl+x and save this file.&lt;/p&gt;

&lt;p&gt;Next, we need to restart the sshd by running this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;service sshd restart&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, we can set a password for our authentication by running this command:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;passwd ubuntu&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;And set your preferred password. And whalah, it’s done!&lt;br&gt;
Now, exit from the server and login again with your password that you’ve set just now. Run this command, and then give the password.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ssh ubuntu@x.x.x.x&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So, isn’t this interesting? :D&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>aws</category>
      <category>passwordlogin</category>
    </item>
    <item>
      <title>How to delete file from aws s3 bucket</title>
      <dc:creator>Md. Abdul Halim Rafi</dc:creator>
      <pubDate>Sun, 26 Apr 2020 03:38:45 +0000</pubDate>
      <link>https://dev.to/mdabdulhalimrafi/how-to-delete-file-from-aws-s3-bucket-5h9o</link>
      <guid>https://dev.to/mdabdulhalimrafi/how-to-delete-file-from-aws-s3-bucket-5h9o</guid>
      <description>&lt;div class="highlight"&gt;&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;AWS&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;S3&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
  &lt;span class="na"&gt;accessKeyId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AWS_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;secretAccessKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AWS_SECRET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;params&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;AWS_BUCKET_NAME&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;Key&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`folder/subfolder/filename.fileExtension`&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;deleteObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;params&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;File has been deleted successfully&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>aws</category>
    </item>
  </channel>
</rss>
