<?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 Irham Dzuhri on Medium]]></title>
        <description><![CDATA[Stories by Irham Dzuhri on Medium]]></description>
        <link>https://medium.com/@irhamdz?source=rss-2222eb79e3ea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QJlB-_b--ngp9Pi--PCpvg.jpeg</url>
            <title>Stories by Irham Dzuhri on Medium</title>
            <link>https://medium.com/@irhamdz?source=rss-2222eb79e3ea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 10:40:19 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@irhamdz/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[How to manage multiple SSH key pairs in 10 minutes.]]></title>
            <link>https://irhamdz.medium.com/how-to-manage-multiple-ssh-key-pairs-in-10-minutes-9123c9fe26e8?source=rss-2222eb79e3ea------2</link>
            <guid isPermaLink="false">https://medium.com/p/9123c9fe26e8</guid>
            <category><![CDATA[azure-devops]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[github]]></category>
            <dc:creator><![CDATA[Irham Dzuhri]]></dc:creator>
            <pubDate>Wed, 14 Oct 2020 12:51:29 GMT</pubDate>
            <atom:updated>2020-10-16T08:56:47.129Z</atom:updated>
            <content:encoded><![CDATA[<p>Connect to multiple SSH key in one environment can be such a hard thing, here’s a little trick on how to set up them all. Cheers!</p><figure><img alt="GitHub, Azure DevOps and Gitlab Trinity" src="https://cdn-images-1.medium.com/max/1024/1*kFDWiZEzWVOuFKOBYZxjTg.png" /><figcaption>GitHub, Gitlab, and Azure DevOps Trinity</figcaption></figure><p>It’s based on my experience working from different remote repository. it began in 2017 when I was working in my first company and the company uses Azure DevOps for their remote repository. since I only have an experience using GitHub so it’s kinda hard for me to connect to multiple repos using ssh ways.</p><p><em>~ I use Ubuntu 18.04 at the moment I write this article. so maybe the syntax will differ from your local environment.</em></p><h3>About SSH</h3><p>Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub or another remote repository without supplying your username or password at each visit.</p><p>for more information about ssh, you can visit <a href="https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/about-ssh">Github docs</a></p><h3>Generate an ssh key in your local environment</h3><p>firstly you need to generate an ssh key in your environment, in this case, we want to create a three different ssh key for let’s say a personal (GitHub), work (Azure DevOps), and another need (Gitlab).</p><p>open your favorite command line and type:</p><p>ssh-keygen -t rsa -b 4096 -C &quot;&lt;your_email@email.com&gt;&quot;</p><p><em>make sure the email is the email you use for login to each remote repository.</em></p><p>and when the command line asks for which file u want to save the SSH, add a <strong>naming</strong> for it so you know which key and what for.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/861/1*vGAo_EImzuo09aEX5D61Fw.png" /><figcaption>naming rsa for GitHub</figcaption></figure><p>the rest just keep the default, and voila! we just add an ssh key pair for GitHub and <strong>do repeat two-step above for Azure DevOps and Gitlab.</strong></p><p>now you should have id_rsa_github.pub, id_rsa_azure.pub, and id_rsa_gitlab.pub files in your environment.</p><h3>Add pub key to the remote repository</h3><h4>GITHUB</h4><ol><li>Open Settings ⇨ SSH and GPG keys ⇨ +New SSH key.</li><li>add your id_rsa_github.pub value.</li><li>save.</li></ol><p><em>in Ubuntu, you can type </em><em>cat id_rsa_github.pub to view the value.</em></p><h4>Azure DevOps</h4><ol><li>Open User settings ⇨ SSH public keys ⇨ +New Key.</li><li>add your id_rsa_azure.pub value.</li><li>save.</li></ol><h4>Gitlab</h4><ol><li>Open Settings ⇨ SSH keys.</li><li>add your id_rsa_gitlab.pub value.</li><li>save.</li></ol><h3>Create a config file</h3><p>create a config file in your ~/.ssh folder to define the mapping from each remote repository.</p><p>touch ~/.ssh/config</p><p>write in the config file like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cUwSpf-paw2VUCeKxnXSew.png" /><figcaption>ssh config file</figcaption></figure><p><a href="https://carbon.now.sh/?bg=rgba(171%2C%20184%2C%20195%2C%201)&amp;t=one-dark&amp;wt=none&amp;l=application%2Fx-sh&amp;ds=true&amp;dsyoff=20px&amp;dsblur=68px&amp;wc=true&amp;wa=true&amp;pv=56px&amp;ph=56px&amp;ln=false&amp;fl=1&amp;fm=Hack&amp;fs=14px&amp;lh=133%25&amp;si=false&amp;es=2x&amp;wm=false&amp;code=Host%2520ssh.dev.azure.com%250AHostName%2520ssh.dev.azure.com%250AIdentityFile%2520~%252F.ssh%252Fid_rsa_azure%250AUser%2520%253Cyour_devops%2540email.com%253E%250AIdentitiesOnly%2520yes%250A%250AHost%2520gitlab%250AHostName%2520https%253A%252F%252Fgitlab.com%252F%253CyourRepositoryName%253E%252F%250AIdentityFile%2520~%252F.ssh%252Fid_rsa_gitlab%250AUser%2520%253Cyour_gitlab%2540email.com%253E%250AIdentitiesOnly%2520yes%250A%250AHost%2520github%250AHostName%2520https%253A%252F%252Fgithub.com%252F%253CyourProfileName%253E%252F%250AIdentityFile%2520~%252F.ssh%252Fid_rsa_github%250AUser%2520%253Cyour_github%2540email.com%253E%250AIdentitiesOnly%2520yes"><em>source</em></a></p><p>save the file.</p><h3>Test for fetch and push</h3><p>you are almost done for set up the multiple key pairs, now it’s time to test it. just clone via ssh from one of the remote repositories and test for fetch and push.</p><p>assuming we clone from GitHub:</p><p>git clone git@github.com:&lt;your_username&gt;/&lt;some_repo.git&gt;</p><p>change to the cloned repository</p><p>cd some_repo</p><p>fetch or update the repository</p><p>git fetch</p><p>if the cmd doesn’t require us to supplying our username or password then you are safe to go :), don’t forget to test the other remote repositories that you defined in the config file.</p><p><em>Thanks for reading this article! Hope this helps :) Leave a comment below if you have any questions. and don&#39;t forget to share this article with your friends and colleagues.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9123c9fe26e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>