<?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>Forem: Ajmal Muhammed</title>
    <description>The latest articles on Forem by Ajmal Muhammed (@ajmalmuhammedn).</description>
    <link>https://forem.com/ajmalmuhammedn</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%2F235645%2F8bf396b6-bd9b-4605-9474-87a0e1f708d9.png</url>
      <title>Forem: Ajmal Muhammed</title>
      <link>https://forem.com/ajmalmuhammedn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/ajmalmuhammedn"/>
    <language>en</language>
    <item>
      <title>Setup Multiple SSH Keys</title>
      <dc:creator>Ajmal Muhammed</dc:creator>
      <pubDate>Sat, 24 Jan 2026 11:43:24 +0000</pubDate>
      <link>https://forem.com/ajmalmuhammedn/setup-multiple-ssh-keys-3de1</link>
      <guid>https://forem.com/ajmalmuhammedn/setup-multiple-ssh-keys-3de1</guid>
      <description>&lt;p&gt;&lt;strong&gt;How to Manage Multiple SSH Keys&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you have multiple keys, create an SSH config file as follow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano ~/.ssh/config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following according to your key name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Host gitlab.com
    HostName gitlab.com
    User git
    IdentityFile ~/.ssh/id_ed25519
    AddKeysToAgent yes

Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519
    AddKeysToAgent yes

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;What if we have multiple GitLab or GitHub keys?&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Edit the config as follows:

# Personal GitLab
Host gitlab.com-personal
    HostName gitlab.com
    User git
    IdentityFile ~/.ssh/gitlab_personal
    AddKeysToAgent yes

# Work GitLab
Host gitlab.com-work
    HostName gitlab.com
    User git
    IdentityFile ~/.ssh/gitlab_work
    AddKeysToAgent yes

# Personal GitHub
Host github.com-personal
    HostName github.com
    User git
    IdentityFile ~/.ssh/github_personal
    AddKeysToAgent yes

# Work GitHub
Host github.com-work
    HostName github.com
    User git
    IdentityFile ~/.ssh/github_work
    AddKeysToAgent yes
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Here, you need to specify custom name for the Host.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set proper permissions&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 600 ~/.ssh/config
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_ed25519
chmod 644 ~/.ssh/id_ed25519.pub
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Clone/Configure repositories with the right host&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Personal GitLab project
git clone git@gitlab.com-personal:username/repo.git

Work GitLab project
git clone git@gitlab.com-work:company/repo.git

Personal GitHub project
git clone git@github.com-personal:username/repo.git

Work GitHub project
git clone git@github.com-work:company/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: above examples are according to the previous config file&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;For existing repositories:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check current remote&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change to personal GitLab&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote set-url origin git@gitlab.com-personal:username/repo.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change to personal GitHub&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git remote set-url origin git@github.com-personal:username/repo.git

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

&lt;/div&gt;



</description>
      <category>git</category>
      <category>github</category>
      <category>gitlab</category>
      <category>programming</category>
    </item>
    <item>
      <title>Complete SSH Key Setup</title>
      <dc:creator>Ajmal Muhammed</dc:creator>
      <pubDate>Sat, 24 Jan 2026 11:26:49 +0000</pubDate>
      <link>https://forem.com/ajmalmuhammedn/complete-ssh-key-setup-502a</link>
      <guid>https://forem.com/ajmalmuhammedn/complete-ssh-key-setup-502a</guid>
      <description>&lt;p&gt;&lt;strong&gt;Step 1: Generate the key&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t ed25519 -C "your_email@example.com"

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

&lt;/div&gt;



&lt;p&gt;Optional: To specify custom names of the key file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t ed25519 -C "your_email@example.com" -f ~/.ssh/my_custom_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Start the ssh-agent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;eval "$(ssh-agent -s)"

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Add your key to ssh-agent&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-add ~/.ssh/id_ed25519

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

&lt;/div&gt;



&lt;p&gt;or if use specified custom name&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-add ~/.ssh/my_custom_name

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Copy your public key&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat ~/.ssh/id_ed25519.pub

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

&lt;/div&gt;



&lt;p&gt;This will display something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJl3dIeudNqd0DPMRD6OIh65A9gg2GPow5Fzy9Hvd1HS your_email@example.com

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

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Add to GitLab or Github&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Copy the entire output from the previous command&lt;/li&gt;
&lt;li&gt;Go to &lt;a href="https://gitlab.com/-/user_settings/ssh_keys/" rel="noopener noreferrer"&gt;https://gitlab.com/-/user_settings/ssh_keys/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Select Add new key&lt;/li&gt;
&lt;li&gt;Paste the key into the "Key" field&lt;/li&gt;
&lt;li&gt;Give it a title (e.g., "Production Server")&lt;/li&gt;
&lt;li&gt;Click "Add key"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Test the connection&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -T git@gitlab.com

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

&lt;/div&gt;



&lt;p&gt;You should see: &lt;strong&gt;Welcome to GitLab, @yourusername!&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>gitlab</category>
      <category>ssh</category>
    </item>
  </channel>
</rss>
