Two or more ssh-keys to github accounts – mac os how to solve ‚Repository not found’ issue

Hello faces… (czyli cześć mordy)! Long time no see. its been more than a year! Last post since 30.04.2018! OMG I’ll not lie, that I was busy… I was just lazy to put anything here… instead of  writing was have been watching tv, hanging around and doing other stuff, but not writing – today is 02.06.2019!!! Its like 13 month of nothing – big gap – but now it will change… or you can say I’ve some more energy to write my blog again. So today on Sunday… and really today is sunny day so instead of doing some activity I’m sitting here and writing blog post, btw today is also penultimate (przedostatni) day of Ramadan… Monday and Eid…  and always after Ramadan there is sunna to fast for 6 days… but never did this, 4… maybe 3  days.. but and than it goes away… ok enough with the introduction…  lets solve real life problems…

Today I finally found time to solve problem why on mac Im getting:

while trying to clone private git repository from my own account (by default Im using working ssh-key). Im using ssh_config for multiple accounts, but on mac it does not work (at least for me). I have :

According to what ssh-key file was loaded firstly I’ve got access or not (by default to mine own repository), first loaded key in ssh-add was blocking another one, and I was still getting the 404 error. It looks like it wasn’t taking IdentifyFile for exact host, so, I found solution to remove all keys from ssh-add (by ssh-add -D) and than add to .ssh/config this:

on the top of file. Im sure about AddKeysToAgent that works and after using any host – it does not add keys to ssh-add, so it does work 😉

 

 

Rafath Khan

Rafath Khan - Problem Solver - nie ma czegoś takiego jak problem, są wyzwania. Od 1998 związany z Internetem, programista, projektant, twórca serwisów i aplikacji internetowych m.in Shoople.pl, PanShop.pl, UnikalneOpisy.pl. Masz problem? Pomogę CI go rozwiązać.

Może Ci się również spodoba