title: SSH uses wrong key when using multiple keys on a single host
body: <p>I'm currently trying to make multiple keys for a single host, but I am running into an an odd issue where the first SSH key that I decide to use, becomes the only SSH key that I can use. I then have to restart my laptop just to change SSH keys. </p>
  
  <p>I'm using a Macbook Pro with Mojave v10.14.6</p>
  
  <p>My SSH config looks like this - </p>
  
  <pre><code>Host github.com-personal
    Hostname github.com
    UseKeychain yes
    AddKeysToAgent yes
    User git
    IdentityFile ~/.ssh/personal
  Host github.com-work
    Hostname github.com
    UseKeychain yes
    AddKeysToAgent yes
    User git
    IdentityFile ~/.ssh/work
  </code></pre>
  
  <p>Since these keys happen to be used for github, I used the following command to test. </p>
  
  <pre><code>ssh -T github.com-work
  </code></pre>
  
  <p>and</p>
  
  <pre><code>ssh -T github.com-personal
  </code></pre>
  
  <p>The problem is, if I run the <code>work</code> command first, the response is - </p>
  
  <pre><code>Hi &lt;&lt;work account&gt;&gt;! You've successfully authenticated, but GitHub does not provide shell access.
  </code></pre>
  
  <p>After that, if I run either of the above commands, the output is the same. </p>
  
  <p>If I run the <code>personal</code> command first, then the output references my <em>personal</em> account until I restart my computer. </p>
  
  <p>Does anyone know what's going on here?</p>