[SOLVED] IdentityFile entry for non-default public key name in MacOS/OSX ssh config file

  • I have a private account under the name irontribe. I am logged out of it on GitHub.

  • I have a free account under the name tomcam.  I am logged into that one.

  • I am trying to set up a GitHub pages project at https://github.com/tomcam/tomcam.github.io

  • I created a public key named tomcam (thus producing tomcam and tomcam.pub), added the key to my GitHub account for tomcam, then updated ~/.ssh/config as follows. 

    Host *
    AddKeysToAgent yes
    UseKeychain yes
    IdentityFile ~/.ssh/tomcam

I am logged in as tomcam. When I do a git push -u origin master  I’m getting this message:

remote: Permission to tomcam/tomcam.github.io.git denied to irontribe.
fatal: unable to access 'https://github.com/tomcam/tomcam.github.io/': The requested URL returned error: 403

 Is the IdentityFile entry correct since I’m not using a default public key filename? (I tried id_rsa anyway and got the same result.)

Or am I doing something else wrong? 

Answer, I think

I think this may have been because I omitted a git commit. Seems nonsensical, but I’ll take what I can get at this hour!

Hi @tomcam So glad to see you were able to find a solution to this!

If you ever open a Topic and then discover the resolution yourself later on, instead of editing your OP, the Community Forum actually has the functionality of allowing you to mark replies as Accepted Solutions. So, if you update your post by actually replying to it yourself and then marking your own reply as the Accepted Solution, it will show other users at a glance that the post has a solution already _and _it creates a link that takes users directly to the solution without having to skim through the OP or other replies first. We recommend updating posts with solutions this way, as it can be quicker and easier for you and other users. 

Thank you for being part of the GitHub Community Forum! We’re really glad you’re here.


1 Like

Thanks, Nadia Joyce. I didn’t know about that feature. Really good support on this forum, thank you.

1 Like