<?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: Mh Asif Kamal</title>
    <description>The latest articles on DEV Community by Mh Asif Kamal (@mhasif0786).</description>
    <link>https://dev.to/mhasif0786</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F772433%2Fddd05310-8d05-4ae4-adfe-125fe77dcdb8.jpeg</url>
      <title>DEV Community: Mh Asif Kamal</title>
      <link>https://dev.to/mhasif0786</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mhasif0786"/>
    <language>en</language>
    <item>
      <title># Real-World SSH: From Your Laptop to the Linux Kernel 🚀</title>
      <dc:creator>Mh Asif Kamal</dc:creator>
      <pubDate>Thu, 25 Jun 2026 17:02:33 +0000</pubDate>
      <link>https://dev.to/mhasif0786/-real-world-ssh-from-your-laptop-to-the-linux-kernel-4b1c</link>
      <guid>https://dev.to/mhasif0786/-real-world-ssh-from-your-laptop-to-the-linux-kernel-4b1c</guid>
      <description>&lt;p&gt;If you work in tech, you use SSH every day. But for a lot of developers, it's just a black box. Let’s pull back the curtain and trace a real-world hands-on sequence on an Ubuntu server to see exactly how the network handoff and Linux &lt;strong&gt;PAM (Pluggable Authentication Modules)&lt;/strong&gt; pipeline work under the hood.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. The Core Concept: Public vs. Private Keys
&lt;/h2&gt;

&lt;p&gt;Instead of using passwords, secure modern SSH relies on asymmetric cryptography:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The Public Key:&lt;/strong&gt; Think of this like a padlock. You can hand it out to anyone or leave it on a public server. It doesn't matter who sees it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Private Key:&lt;/strong&gt; This is the physical key that opens the padlock. It stays safely on your laptop, and you &lt;strong&gt;never&lt;/strong&gt; share it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  2. Hands-On: Solving "Permission Denied" in Real-Time 🛠️
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Step 1: The Error
&lt;/h3&gt;

&lt;p&gt;Connecting to a cloud instance without an authorized key fails immediately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mhasifkamal@Mhs-MacBook-Air work % ssh mhasifkamal@34.131.76.231
mhasifkamal@34.131.76.231: Permission denied &lt;span class="o"&gt;(&lt;/span&gt;publickey&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Generating the Match
&lt;/h3&gt;

&lt;p&gt;Run &lt;code&gt;ssh-keygen&lt;/code&gt;. On modern operating systems, it automatically defaults to the highly secure &lt;strong&gt;ED25519&lt;/strong&gt; algorithm:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mhasifkamal@Mhs-MacBook-Air work % ssh-keygen
Generating public/private ed25519 key pair.
Enter file in which to save the key (/Users/mhasifkamal/.ssh/id_ed25519): ssh_key
Your identification has been saved in ssh_key
Your public key has been saved in ssh_key.pub

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 3: Verifying the Files
&lt;/h3&gt;

&lt;p&gt;Your system sets strict, private read/write privileges (&lt;code&gt;-rw-------&lt;/code&gt;) for the private key, while leaving the &lt;code&gt;.pub&lt;/code&gt; lock file readable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mhasifkamal@Mhs-MacBook-Air work % ls -l
-rw-------  1 mhasifkamal  staff  432 Jun 25 21:42 ssh_key
-rw-r--r--  1 mhasifkamal  staff  115 Jun 25 21:42 ssh_key.pub

mhasifkamal@Mhs-MacBook-Air work % cat ssh_key.pub 
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFHgEWeyk6UwHRs4VknwryjptBQcG/dYufjCJu8oq+Qe...

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 4: The Payoff
&lt;/h3&gt;

&lt;p&gt;Point directly to your private key file using the &lt;code&gt;-i&lt;/code&gt; flag to unlock entry:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mhasifkamal@Mhs-MacBook-Air work % ssh -i ssh_key mhasifkamal@34.131.76.231 
Welcome to Ubuntu 24.04.4 LTS (GNU/Linux 6.17.0-1018-gcp x86_64)
mhasifkamal@instance-20260620-113027:~$ 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  3. Where the Lock Lives 📂
&lt;/h2&gt;

&lt;p&gt;Once you log in, navigate to your home directory's hidden &lt;code&gt;.ssh&lt;/code&gt; folder. All authorized locks are stored in a single text file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mhasifkamal@instance-20260620-113027:~&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; .ssh/
mhasifkamal@instance-20260620-113027:~/.ssh&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;ls
&lt;/span&gt;authorized_keys
mhasifkamal@instance-20260620-113027:~/.ssh&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vi authorized_keys 

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Cloud setup panels and commands like &lt;code&gt;ssh-copy-id&lt;/code&gt; simply append your public key string into this &lt;code&gt;authorized_keys&lt;/code&gt; file.&lt;/em&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  4. Toggling Passwords &amp;amp; The Cloud Override Trap 🕸️
&lt;/h2&gt;

&lt;p&gt;Let's create a traditional password user named &lt;code&gt;test-user&lt;/code&gt; on the server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mhasifkamal@instance-20260620-113027:~/.ssh$ sudo adduser test-user
New password: 
passwd: password updated successfully

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Trying to log in immediately from your laptop will still fail:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mhasifkamal@Mhs-MacBook-Air work % ssh test-user@34.131.76.231
test-user@34.131.76.231: Permission denied (publickey).

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The Fix
&lt;/h3&gt;

&lt;p&gt;To allow temporary password logins, you must modify the incoming SSH daemon settings. Avoid &lt;code&gt;ssh_config&lt;/code&gt; (which handles outbound client connections) and focus on the drop-in cloud override files inside &lt;code&gt;/etc/ssh/sshd_config.d/&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mhasifkamal@instance-20260620-113027:/etc/ssh$ ls /etc/ssh/sshd_config.d/
50-cloudimg-settings.conf  60-cloudimg-settings.conf

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open these overrides, change the parameter to &lt;code&gt;yes&lt;/code&gt;, and restart the daemon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;vi /etc/ssh/sshd_config.d/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;span class="c"&gt;# Set: PasswordAuthentication yes&lt;/span&gt;

&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart ssh

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, the server prompts for the password and allows authentication cleanly:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mhasifkamal@Mhs-MacBook-Air work % ssh test-user@34.131.76.231
test-user@34.131.76.231's password: 
Welcome to Ubuntu 24.04.4 LTS!

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  5. Under the Hood: The Complete Architecture Flow 🔄
&lt;/h2&gt;

&lt;p&gt;Here is exactly how the network handoff transitions directly into Linux's internal &lt;strong&gt;PAM (Pluggable Authentication Modules)&lt;/strong&gt; pipeline:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[ LAPTOP ]                                                [ UBUNTU SERVER ]
    │                                                            │
    ├─── 1. Protocol Handshake (Agree on SSH versions) ─────────&amp;gt;│
    │                                                            │
    &amp;lt;─── 2. Diffie-Hellman Key Exchange (Secure Tunnel Built) ──&amp;gt;│
    │                                                            │
    &amp;lt;─── 3. Asymmetric Key Challenge (Puzzle sent to client) ────┤
    │                                                            │
    ├─── 4. Challenge Solved (Proof verified by sshd) ──────────&amp;gt;│
    │                                                            │
    │                                                   [ Hand-off to PAM Engine ]
    │                                                            │
    │                                                   ┌────────┴────────┐
    │                                                   │  /etc/pam.d/    │
    │                                                   └────────┬────────┘
    │                                                            │
    │                                                   🔒 1. common-auth
    │                                                      (Checks credentials via pam_unix.so)
    │                                                            │
    │                                                   📋 2. common-account
    │                                                      (Checks password expiration/locks)
    │                                                            │
    │                                                   🛠️ 3. common-session
    │                                                      (Sets env, umask, &amp;amp; log limits)
    │                                                            │
    &amp;lt;─── 5. Shell Opened (PTY Allocated to user) ────────────────┘

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  The PAM Blueprint
&lt;/h3&gt;

&lt;p&gt;Modern Linux environments manage application access dynamically via files in &lt;code&gt;/etc/pam.d/&lt;/code&gt;. (The old master file &lt;code&gt;/etc/pam.conf&lt;/code&gt; is ignored).&lt;/p&gt;

&lt;p&gt;When we look inside the system authentication rules (&lt;code&gt;cat /etc/pam.d/common-auth&lt;/code&gt;), we see the literal logical circuit board:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;auth    [success=1 default=ignore]      pam_unix.so nullok
auth    requisite                       pam_deny.so
auth    required                        pam_permit.so

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;pam_unix.so&lt;/code&gt;:&lt;/strong&gt; Checks credentials against system hashes. If successful, &lt;code&gt;[success=1]&lt;/code&gt; jumps past the next line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;pam_deny.so&lt;/code&gt;:&lt;/strong&gt; The trap line. If your credentials fail, PAM stops here, breaks the circuit, and kicks you out with a &lt;code&gt;Permission denied&lt;/code&gt; error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;pam_permit.so&lt;/code&gt;:&lt;/strong&gt; The green light. Passes a success flag back to the environment, allowing &lt;code&gt;common-session&lt;/code&gt; to spin up your environment variables and launch your &lt;code&gt;bash&lt;/code&gt; or &lt;code&gt;zsh&lt;/code&gt; shell.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Wrap Up 🎯
&lt;/h2&gt;

&lt;p&gt;SSH builds the secure tunnel across the web, but PAM controls your access rights once you cross the threshold. Hardening your server by setting your drop-in configs back to &lt;code&gt;PasswordAuthentication no&lt;/code&gt; keeps the automated brute-force bots completely out of your architecture.&lt;/p&gt;

&lt;p&gt;What does your local &lt;code&gt;~/.ssh/config&lt;/code&gt; file look like? Let's chat in the comments! 👇&lt;/p&gt;

&lt;p&gt;#sre #ssh #linux #devops #security #sysadmin #tutorial&lt;/p&gt;

</description>
      <category>linux</category>
      <category>networking</category>
      <category>security</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>#Kafka</title>
      <dc:creator>Mh Asif Kamal</dc:creator>
      <pubDate>Sat, 11 Dec 2021 16:18:20 +0000</pubDate>
      <link>https://dev.to/mhasif0786/kafka-hed</link>
      <guid>https://dev.to/mhasif0786/kafka-hed</guid>
      <description>&lt;p&gt;Hi all,&lt;br&gt;
As i asked in morning here about kafka resources.So today i started kafka and learn about basics of kafka. &lt;br&gt;
Things which i have learnt today.&lt;br&gt;
What is kafka?&lt;br&gt;
Kafka is basically a message queue system.It actually solve the complex problem of communication between many to many.It reduces the number of connection. It creates a medium between producer and consumer.Producer will publish message in kafka cluster and consumer will consume the message from kafka cluster.&lt;br&gt;
Components of kafka:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Producer&lt;/li&gt;
&lt;li&gt;Consumer&lt;/li&gt;
&lt;li&gt;Topic&lt;/li&gt;
&lt;li&gt;Broker&lt;/li&gt;
&lt;li&gt;Partition
I learnt about this and also install on system and publish messages and consume message.
If anything you might feel wrong please comment so that i can rectify.
Thanks .&lt;/li&gt;
&lt;/ol&gt;

</description>
    </item>
    <item>
      <title>#kafka</title>
      <dc:creator>Mh Asif Kamal</dc:creator>
      <pubDate>Sat, 11 Dec 2021 06:18:27 +0000</pubDate>
      <link>https://dev.to/mhasif0786/kafka-3ae3</link>
      <guid>https://dev.to/mhasif0786/kafka-3ae3</guid>
      <description>&lt;p&gt;Hi I am started learning Kafka. Suggest some good  resources,Thanks.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
