title: ssh conflicts / github permission denied but authentication success, what is wrong?
body: <p>I already have a github account and using it without a problem using gitbash -clone/pull/push.
  Now I currently created another github account to work with a friend and realized I couldn't push due to account conflict or whatever it is called.
  So I created a new ssh key and went through a few threads but still didn't get it working but I am able to authenticate between two different git accounts but now I couldn't push or clone due to access rights.</p>
  
  <p>I don't remember the exact all steps I did because I was going through different threads and trying different things.  By the way I'm using windows.</p>
  
  <p><strong>1st</strong></p>
  
  <p>I went to the <code>/.ssh</code> and changed my previous <code>id_rsa</code> and <code>id_rsa.pub</code> into <code>id_rsa_acc1</code> and <code>id_rsa_acc2</code></p>
  
  <p><strong>2nd</strong></p>
  
  <p>I created another key using
  <code>ssh-keygen -t rsa -C "email@email.com"</code>  <em>my previous ssh uses the same email too</em>
  <br></p>
  
  <p><strong>3rd</strong></p>
  
  <p>I went to the <code>/.ssh</code> and changed my new <code>id_rsa</code> and <code>id_rsa.pub</code> into <code>id_rsa_acc2</code> and <code>id_rsa_acc2</code></p>
  
  <p><strong>4th</strong></p>
  
  <p>in <code>.ssh</code> folder I created a file called <code>config</code> and added <br></p>
  
  <pre><code># acc1 GitHub
  Host acc1 .github.com
  HostName github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa_acc1
  
  # acc2 GitHub
  Host acc2.github.com
  HostName github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa_acc2
  </code></pre>
  
  <p><strong>5th</strong></p>
  
  <p>I login into github.com with my acc2 and added the ssh key in <code>/.ssh/id_rsa_acc2.pub</code> into github settings>SSH keys</p>
  
  <p><strong>6th</strong></p>
  
  <pre><code>eval `ssh-agent -s`
  ssh-add
  </code></pre>
  
  <p><strong>7th</strong></p>
  
  <pre><code>ssh-add ~/.ssh/id_rsa_acc1
  ssh-add ~/.ssh/id_rsa_acc2
  </code></pre>
  
  <p><strong>8th</strong></p>
  
  <pre><code>ssh -T git@acc1.github.com
  Hi acc1! You've successfully authenticated, but GitHub does not provide shell access.
  
  ssh -T git@acc2.github.com
  Hi acc2! You've successfully authenticated, but GitHub does not provide shell access.
  </code></pre>
  
  <p>I couldn't find one of the error messages anymore but when I tried to push into the acc2 it said something about denying access because of acc1 or something like that.
  Then I tried using clone by ssh url and couldn't even clone any of these two accounts from github.</p>
  
  <p>Now when I try to clone/push/pull I only get such error message
      Permission denied (publickey).
      fatal: Could not read from remote repository.</p>
  
  <pre><code>Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  
  <p>Can someone please give me a hand?</p>