<?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: Yash Kadaru</title>
    <description>The latest articles on DEV Community by Yash Kadaru (@yashsway).</description>
    <link>https://dev.to/yashsway</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%2F155101%2Fefb73401-b89b-416a-b417-a093143b50de.jpg</url>
      <title>DEV Community: Yash Kadaru</title>
      <link>https://dev.to/yashsway</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yashsway"/>
    <language>en</language>
    <item>
      <title>Sketch symbol folder frustrations</title>
      <dc:creator>Yash Kadaru</dc:creator>
      <pubDate>Sat, 13 Jul 2019 15:34:22 +0000</pubDate>
      <link>https://dev.to/yashsway/sketch-symbol-folder-frustrations-22c0</link>
      <guid>https://dev.to/yashsway/sketch-symbol-folder-frustrations-22c0</guid>
      <description>&lt;p&gt;One of the things that annoy me the most with Sketch, is the seemingly strage behavior with symbol folders.&lt;/p&gt;

&lt;p&gt;The UI isn't very helpful in this regard and neither does it seem to be properly documented anywhere in a succint way.&lt;/p&gt;

&lt;p&gt;So I contact Sketch support hoping to get some insight. The very helpful &lt;em&gt;Alberto Araújo&lt;/em&gt;, a customer support employee replied:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Sketch will automatically apply the desired nesting structure for Symbols with "/" in their name.&lt;br&gt;
However, when only a single Symbol is contained within any parent folder, then Sketch will simply show that Symbol's name in full rather than nesting a Symbol within a submenu.&lt;/p&gt;

&lt;p&gt;When two or more Symbols are named with the same preceding title, then the expected submenu structure will be shown in the various Symbol-related menus.&lt;br&gt;
To see this in action, I recommend creating a two Symbols, for example "button / landing1" and "button / landing2". &lt;/p&gt;

&lt;p&gt;You will then notice that both the "landing1" and "landing2" Symbols will now be found within a "button" submenu.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Finally!&lt;br&gt;
I understand how it works now.&lt;/p&gt;

</description>
      <category>sketch</category>
      <category>ui</category>
      <category>ux</category>
    </item>
    <item>
      <title>How to setup multiple SSH keys for multiple git accounts (MacOS + Windows)</title>
      <dc:creator>Yash Kadaru</dc:creator>
      <pubDate>Thu, 25 Apr 2019 00:02:24 +0000</pubDate>
      <link>https://dev.to/yashsway/setting-up-multiple-ssh-profiles-to-manage-multiple-git-accounts-macos-3m7m</link>
      <guid>https://dev.to/yashsway/setting-up-multiple-ssh-profiles-to-manage-multiple-git-accounts-macos-3m7m</guid>
      <description>&lt;p&gt;When I first ran into this problem of managing multiple git accounts, I had done a ton of research online. There were a lot of helpful sources of information, but they all had something missing. I had to patch together information from a variety of places. I’m bringing all my learning together here, to pass the baton I was given.😅&lt;/p&gt;

&lt;p&gt;Before we get started, let me outline a few of the questions I will be answering in this article. I’ll be addressing:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Where are SSH keys stored on a Mac? What’s an RSA key?&lt;/li&gt;
&lt;li&gt;What is an SSH config and how can I set one up?&lt;/li&gt;
&lt;li&gt;What is a known_hosts file and what is an id_rsa file?&lt;/li&gt;
&lt;li&gt;How can I manage all my SSH keys? What are SSH keys anyway?&lt;/li&gt;
&lt;/ol&gt;




&lt;p&gt;If you’re wondering what SSH is, we won’t be covering the answer to that here, but you are welcome to take a look at the &lt;a href="https://www.ssh.com/ssh/" rel="noopener noreferrer"&gt;official page&lt;/a&gt; from the organization behind SSH. This page is quite helpful and concise.&lt;/p&gt;

&lt;p&gt;MacOS ships with the &lt;strong&gt;OpenSSH&lt;/strong&gt; implementation of SSH. You’ll notice this particular statement from the site:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The OpenSSH client program is called ssh. The SSH client generally uses information in the .ssh directory in the user’s home directory. It also reads &lt;code&gt;/etc/ssh/ssh_config&lt;/code&gt;, which contains its system-wide configuration.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;For the purposes of this article, we won’t worry about the system-wide configuration in this article. In most Unix / Linux systems, the local configuration is found in the user’s home directory under &lt;code&gt;.ssh&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  📚 Soaking up some knowledge
&lt;/h2&gt;

&lt;p&gt;Okay, let’s find it! Boot up your terminal, and head on over to &lt;code&gt;~/.ssh&lt;/code&gt; like so:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs7i54srr2b7hedza3fe.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs7i54srr2b7hedza3fe.jpg" alt=".ssh directory under your home directory" width="800" height="113"&gt;&lt;/a&gt;&lt;/p&gt;
Make sure you’re in your root / home directory, then navigate to the .ssh folder



&lt;p&gt;In this folder, you might see a couple of files, or none at all. For me, this is what it looks like below. What is this nonsense?&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjjnlxmk9hc6aiy8hlrmx.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjjnlxmk9hc6aiy8hlrmx.jpg" alt=".ssh folder might have multiple files in it already" width="589" height="152"&gt;&lt;/a&gt;&lt;/p&gt;
Usually, you might find a known_hosts file here already. You might also have an id_rsa and an `id_rsa.pub file here.



&lt;p&gt;To explain what these are, we need to talk about &lt;a href="https://www.ssh.com/ssh/key/" rel="noopener noreferrer"&gt;keys&lt;/a&gt; first. There are a few types:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Authorized keys&lt;/strong&gt; and &lt;strong&gt;Identity keys&lt;/strong&gt; are &lt;em&gt;user&lt;/em&gt; keys. Authorized keys are &lt;em&gt;public&lt;/em&gt; keys, similar to a lock. (🔒) Identity keys, are &lt;em&gt;private&lt;/em&gt; keys, similar to a key that opens that lock. (🔑)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Host keys&lt;/strong&gt; are for host authentication, i.e. the entity you are trying to connect to. They are &lt;em&gt;public&lt;/em&gt; keys. (🔒)&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;known_hosts&lt;/code&gt; file is where OpenSSH stores or remembers hosts that it has connected to previously. It only remembers host keys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session&lt;/strong&gt; keys encrypt the data in a connection. They change every session and use the host key to generate or use a mutual shared key.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We’ll get into &lt;a href="https://security.stackexchange.com/questions/84773/difference-between-public-key-and-host-key-and-security-of-host-key?newreg=4846631c015449f5bc46f97c27e7a48e" rel="noopener noreferrer"&gt;how the key exchange works&lt;/a&gt; in a later article.&lt;/p&gt;

&lt;p&gt;We’re primarily concerned with &lt;strong&gt;Identity keys&lt;/strong&gt; and &lt;strong&gt;Host keys&lt;/strong&gt;. Your identity keys when generated with no options look like &lt;code&gt;id_&amp;lt;algorithm it was made with&amp;gt;&lt;/code&gt; by default and are usually in this &lt;code&gt;.ssh&lt;/code&gt; folder. &lt;strong&gt;RSA&lt;/strong&gt; is the most common algorithm in use, and the most widely supported, so you’ll see keys that look like &lt;code&gt;id_rsa&lt;/code&gt;. RSA also happens to be the default algorithm. (&lt;a href="https://security.stackexchange.com/questions/23383/ssh-key-type-rsa-dsa-ecdsa-are-there-easy-answers-for-which-to-choose-when" rel="noopener noreferrer"&gt;Click here if you want to know more about the other algorithms&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;However, it is possible to specify any file name, and any location when creating a private key. You can also provide a custom path pointing to a key somewhere else, with the &lt;code&gt;-i&lt;/code&gt; option to the SSH client. For example, &lt;code&gt;ssh -i /home/me/somepath/my-awesome-key ec2-user@awshost.amazon.com&lt;/code&gt; would use a private key from the file &lt;code&gt;my-awesome-key&lt;/code&gt; for authentication when opening a secure shell to &lt;code&gt;awshost.amazon.com&lt;/code&gt; as &lt;code&gt;ec2-user&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  💻 Setup
&lt;/h2&gt;

&lt;p&gt;It’s time to generate a key! To do this, we’ll need to use the ssh-keygen command to make a key with a certain algorithm. Here’s what we’re going to run:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen -t rsa -f personal_key -b 2048
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;-t&lt;/code&gt; specifies the algorithm that makes the key. &lt;code&gt;-f&lt;/code&gt; specifies a custom name for the key, and an alternate location if it’s in the form of a path. &lt;code&gt;-b&lt;/code&gt; specifies how many bits long the key will be. By default, ssh-keygen will use the RSA algorithm with 2048 bit length. So, all we really need to do is specify a custom name!&lt;/p&gt;

&lt;p&gt;⚠️ Make sure an existing &lt;code&gt;id_rsa&lt;/code&gt; and &lt;code&gt;id_rsa&lt;/code&gt; keypair don’t exist already. If they do, keygen will ask if you want to overwrite. This will permanently delete that old key you might have used elsewhere! Back it up, make a key with a different name, or if you’re sure, overwrite it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0t9bal8a3q0kzvqitvr1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0t9bal8a3q0kzvqitvr1.jpg" alt="using ssh-keygen to make a key" width="800" height="115"&gt;&lt;/a&gt;&lt;/p&gt;
Run the command in the same folder you are in to generate a key in that location. A passphrase is a good idea!



&lt;p&gt;Make sure you enter a simple passphrase (🔐) that you can keep safe elsewhere.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bzpspuzzbqhmy2czfu6.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6bzpspuzzbqhmy2czfu6.jpg" alt="successful key-gen" width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;
If successful, you’ll see something like this.



&lt;p&gt;This will generate two files: &lt;code&gt;personal_key&lt;/code&gt; and &lt;code&gt;personal_key.pub&lt;/code&gt;. The first is your private key (🔑), the second is your public key (🔒).&lt;/p&gt;

&lt;p&gt;Now, repeat the same process for your work account. In this manner, you can make as many keys as you want. But for this article, let’s make one more.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fztlwcr24u3p9zgbm0ciu.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fztlwcr24u3p9zgbm0ciu.jpg" alt="another work key made with ssh-keygen" width="800" height="387"&gt;&lt;/a&gt;&lt;/p&gt;
A new work_key with a different passphrase.



&lt;p&gt;It’s time to make two hosts files for each of your profiles. You don’t have to make two, but it’s nice to keep the profiles completely separate. Run the following commands to generate the two files:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch known_hosts
touch known_hosts_work
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;❗️&lt;strong&gt;NOTE&lt;/strong&gt;: if you have a &lt;code&gt;known_hosts&lt;/code&gt; file here already, there’s no need to make another one. If you want to rename it, you can do that — just make sure you use that name for the following steps.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠 Connect the dots with a config file
&lt;/h2&gt;

&lt;p&gt;Finally, let’s bring it all together in a &lt;a href="https://www.ssh.com/ssh/config/" rel="noopener noreferrer"&gt;config file&lt;/a&gt;. There’s two of them, one for local, and one for global. As mentioned before, we’re focussing on the local. Use the following command to make a config file:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Here’s what your final config file will look like:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frina7ifhbnalvinv6y09.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frina7ifhbnalvinv6y09.jpg" alt="the final config file showing 2 profiles" width="499" height="396"&gt;&lt;/a&gt;&lt;/p&gt;
Your key names here might be different based on what you used.



&lt;p&gt;The config file is organized by hosts. Each host definition has a set of &lt;a href="https://linux.die.net/man/5/ssh_config" rel="noopener noreferrer"&gt;connection options&lt;/a&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comments can be made with &lt;code&gt;#&lt;/code&gt; at the start of a line. These are for your eyes.&lt;/li&gt;
&lt;li&gt;The URL on the &lt;code&gt;HostName&lt;/code&gt; line is the exact base URL at which your repository resides. This is your destination. For example, if you have a personal account on github, with personal projects, the URL will be &lt;code&gt;github.com&lt;/code&gt;. In my case, I have my work version-control host URL, and my personal account at &lt;code&gt;github.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Host&lt;/code&gt; is a pattern matcher that is used to differentiate between these sets of configurations. Keep it the same as the &lt;code&gt;HostName&lt;/code&gt; so it matches hosts in connections correctly without additional specification. If you want to use the &lt;code&gt;personal_key&lt;/code&gt; as a fallback for every other URL, use an asterix &lt;code&gt;*&lt;/code&gt; as the Host. The &lt;code&gt;Host *&lt;/code&gt; configuration set is usually at the bottom of the config file, so it tests very configuration set until it gets to this one, if none of the previous Host patterns match.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;User&lt;/code&gt; for most git based systems will just be &lt;code&gt;git&lt;/code&gt;. It will be different based on what you’re connecting to. E.g. &lt;code&gt;ec2-user&lt;/code&gt; if you’re connecting to an Amazon AWS EC2 instance at &lt;code&gt;ec2-user@some_server.amazonaws.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IdentityFile&lt;/code&gt; asks for the location of the identity key we made. Type in the respective paths here.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;UserKnownHostsFile&lt;/code&gt; specifies an exact location to store all hosts you connect to when you’re using that profile. Provide the respective paths here.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;IdentitiesOnly&lt;/code&gt; specifies that only these keys provided must be used to connect to a host, even if another service, like the &lt;em&gt;ssh-agent&lt;/em&gt;, offers a key for use.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Port&lt;/code&gt; specifies what port number to use when connecting through SSH.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ♻️ Cleanup
&lt;/h2&gt;

&lt;p&gt;Let’s do some cleanup before we move on to the final step. We need to make the keys only readable by you, that way no one else can modify or tamper with your private keys.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;ls -l&lt;/code&gt; to check the file permissions for everything in this folder:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xr8crphsemrns6mkomc.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6xr8crphsemrns6mkomc.jpg" alt="Running ls -l in bash" width="464" height="323"&gt;&lt;/a&gt;&lt;/p&gt;
Running `ls -l` will show you the permissions on each file you’ve made



&lt;p&gt;You want every file in here to be readable / writable by you, and only readable by everyone else — which means each file will have this: &lt;code&gt;-rw-r--r--&lt;/code&gt; on the far left column. Let me illustrate how permissions work:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fce1bo1pcas6qlh4hz2lx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fce1bo1pcas6qlh4hz2lx.png" alt="Permissions on a linux based system can be set one of two ways: with letters or with numbers" width="800" height="1066"&gt;&lt;/a&gt;&lt;/p&gt;
There’s 2 ways to set permissions: with letters or with numbers



&lt;p&gt;As you can see in the picture above, there's 2 ways to set permissions. Either one of the following commands in your terminal work.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod go-wx, u=rw personal_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;or&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 600 personal_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  With letters
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;go-wx&lt;/code&gt; removes write and execute permissions from the group and others. &lt;code&gt;u=rw&lt;/code&gt; sets the user (you) to only have read and write permissions.&lt;br&gt;
&lt;code&gt;+&lt;/code&gt; adds permissions that follow. &lt;code&gt;—&lt;/code&gt; removes permissions that follow. &lt;code&gt;=&lt;/code&gt; sets the permissions to exactly what follows.&lt;/p&gt;

&lt;p&gt;You can separate as many sets of these as you want, with commas &lt;code&gt;,&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  With numbers
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;644&lt;/code&gt; sets (4+2) read and write for you, and (4) read permission for everyone else. This should be done on the public keys only.&lt;br&gt;
&lt;code&gt;600&lt;/code&gt; sets (4+2) read and write permissions for you, and no permissions for everyone else. This should be done on all the secret keys.&lt;/p&gt;

&lt;p&gt;Either method you use, make sure all the public keys show &lt;code&gt;rw&lt;/code&gt; for you and &lt;code&gt;r&lt;/code&gt; for everyone else, while the secret keys show &lt;code&gt;rw&lt;/code&gt; for you and nothing for everyone else.&lt;/p&gt;
&lt;h2&gt;
  
  
  ✅ Ready all the systems
&lt;/h2&gt;

&lt;p&gt;Almost there!&lt;/p&gt;

&lt;p&gt;The last step is to add the keys to an ssh-agent so you don’t have to enter the passphrase and specify the key to use every time you ssh to a host. The agent essentially acts like your personal assistant; a butler of sorts. Take this quote from &lt;a href="https://help.github.com/en/articles/which-remote-url-should-i-use" rel="noopener noreferrer"&gt;github.com&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When you &lt;code&gt;git clone&lt;/code&gt;, &lt;code&gt;git fetch&lt;/code&gt;, &lt;code&gt;git pull&lt;/code&gt;, or &lt;code&gt;git push&lt;/code&gt; to a remote repository using SSH URLs, you'll be prompted for a password and must provide your &lt;a href="https://help.github.com/en/articles/working-with-ssh-key-passphrases/" rel="noopener noreferrer"&gt;SSH key passphrase&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Why type the passphrase everytime, when the ssh-agent can do it for you?&lt;/p&gt;

&lt;p&gt;Let’s &lt;em&gt;add&lt;/em&gt; both our keys to the agent using the following command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-add -K personal_key
ssh-add -K work_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;✋you might be asked for your &lt;strong&gt;passphrase&lt;/strong&gt; when adding your keys.&lt;br&gt;
✋the &lt;code&gt;-K&lt;/code&gt; option might not work for you. This is a Mac only command that adds the key passphrase to your OS keychain. If you forget your passphrase, you can &lt;a href="https://apple.stackexchange.com/questions/265131/recover-ssh-private-key-passphrase-from-keychain" rel="noopener noreferrer"&gt;access it through Keychain Access&lt;/a&gt;. If you have trouble using this option, check the &lt;em&gt;troubleshooting&lt;/em&gt; section at the end of this article.&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52yrqlx2gmjqook24wve.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F52yrqlx2gmjqook24wve.jpg" alt="ssh-add help page" width="559" height="452"&gt;&lt;/a&gt;&lt;/p&gt;
Macs have a -K and -A option which can be used to manage your passphrases through the OS’ Keychain.



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3z0te6ot6kgdfjo3f5s7.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3z0te6ot6kgdfjo3f5s7.jpg" alt="Additional config file options for MacOS related to Keychain" width="414" height="199"&gt;&lt;/a&gt;&lt;/p&gt;
With the latest macOS (Sierra or above), there are 2 new configuration options which are very useful.



&lt;p&gt;To &lt;em&gt;list&lt;/em&gt; the keys you just added:&lt;/p&gt;

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

&lt;/div&gt;

&lt;p&gt;To &lt;em&gt;delete&lt;/em&gt; all keys from just the agent, use:&lt;/p&gt;

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

&lt;/div&gt;

&lt;p&gt;⚠️ Note that your keys are on an agent, so a passphrase isn’t required. Make sure no one else has access to your computer!&lt;/p&gt;

&lt;h2&gt;
  
  
  🔗 Test your connection
&lt;/h2&gt;

&lt;p&gt;Now it’s time to add your keys to your accounts. Use the following to copy your respective key:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pbcopy &amp;lt; personal_key.pub
cat personal_key.pub | pbcopy # alternative command!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;⚠️ Notice how the .pub key is used. This is the public (🔒) identity key that you want to provide to your git service. Don’t use your private (🔑) key! (the other file without the &lt;code&gt;.pub&lt;/code&gt; extension)&lt;/p&gt;

&lt;p&gt;Now paste it in the appropriate account, where SSH keys can be added. For github, you can get there through your personal settings:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9iwgkcx7949t2d3j2vbm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9iwgkcx7949t2d3j2vbm.jpg" alt="Adding SSH keys on Github" width="766" height="435"&gt;&lt;/a&gt;&lt;/p&gt;
For Github, this is where you’d add your shiny new key. NOTE: paste it exactly as it appears in the key file!



&lt;p&gt;Say you want to clone your repo locally. This is what the URL would look like:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tk46ryn6lzinife4i0y.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2tk46ryn6lzinife4i0y.jpg" alt="Github repo SSH url" width="386" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Github says &lt;code&gt;git@github.com:some_cool_project&lt;/code&gt; is what you want to use when cloning this project with the command: &lt;code&gt;git clone git@github.com:some_cool_project&lt;/code&gt;.&lt;br&gt;
Now, instead of &lt;code&gt;git@github.com&lt;/code&gt;, if you used a different &lt;code&gt;User&lt;/code&gt; and &lt;code&gt;Host&lt;/code&gt; in the config file, you'd replace those parts of the clone command. For example, say you used &lt;code&gt;another_user&lt;/code&gt; for &lt;code&gt;User&lt;/code&gt; and &lt;code&gt;personal.github.com&lt;/code&gt; for the &lt;code&gt;Host&lt;/code&gt; you'd write:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone another_user@personal.github.com:some_cool_project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;⚠️ Your git user name and email must be &lt;a href="https://medium.com/r/?url=https%3A%2F%2Fhelp.github.com%2Fen%2Farticles%2Fsetting-your-commit-email-address-in-git" rel="noopener noreferrer"&gt;configured locally for every project&lt;/a&gt;, or you'll end up making commits on work and personal accounts with the global user name and email you've set for git!&lt;/p&gt;

&lt;p&gt;💡 I'll do a deep-dive into the git config in a later article. Stay tuned!&lt;/p&gt;




&lt;p&gt;You're all done! No need to manually specify the key you want to use, every-time you connect with SSH. The config and agent will automatically determine what key to use based on the host you're connecting to.&lt;/p&gt;

&lt;p&gt;I hope that this article helped you today. If you feel like it'll help others, or if you have a correction or suggestion, I would love to hear from you. If you want to replicate this article for other operating systems, I would love to hear from you as well. Cheers!&lt;/p&gt;




&lt;h4&gt;
  
  
  Troubleshooting links
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://medium.com/r/?url=https%3A%2F%2Fhelp.github.com%2Fen%2Farticles%2Ferror-ssh-add-illegal-option----k" rel="noopener noreferrer"&gt;https://medium.com/r/?url=https%3A%2F%2Fhelp.github.com%2Fen%2Farticles%2Ferror-ssh-add-illegal-option----k&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  Further exploration
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://medium.com/r/?url=http%3A%2F%2Fwww.snailbook.com%2Ffaq%2Fabout-agent.auto.html" rel="noopener noreferrer"&gt;https://medium.com/r/?url=http%3A%2F%2Fwww.snailbook.com%2Ffaq%2Fabout-agent.auto.html&lt;/a&gt;&lt;br&gt;
Understand ssh-agent and ssh-add - &lt;a href="http://blog.joncairns.com/2013/12/understanding-ssh-agent-and-ssh-add/" rel="noopener noreferrer"&gt;http://blog.joncairns.com/2013/12/understanding-ssh-agent-and-ssh-add/&lt;/a&gt;&lt;br&gt;
SSH Key types (read about the better ed25519 key algorithm that is now in use)- &lt;a href="https://chealion.ca/2016/06/20/ssh-key-types-and-cryptography-the-short-notes/" rel="noopener noreferrer"&gt;https://chealion.ca/2016/06/20/ssh-key-types-and-cryptography-the-short-notes/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>workflow</category>
      <category>ssh</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How is the 'Click here to get the latest version', made for web apps?</title>
      <dc:creator>Yash Kadaru</dc:creator>
      <pubDate>Mon, 22 Apr 2019 03:41:13 +0000</pubDate>
      <link>https://dev.to/yashsway/how-is-the-click-here-to-get-the-latest-version-made-for-web-apps-1bm9</link>
      <guid>https://dev.to/yashsway/how-is-the-click-here-to-get-the-latest-version-made-for-web-apps-1bm9</guid>
      <description>&lt;p&gt;I've noticed this in a couple of web apps recently, how is the production app updated live without disrupting users who are currently logged in / using the app?&lt;/p&gt;

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