News for hackers. Stuff that matters.
Re:Use multiple Git SSH identities on a single computer by ryan-c on Thursday July 20, 2023 @07:59AM (#36799271)
You can do a bit more, even: https://rya.nc/multi-github-accts.html

    Host *.github.com
        IdentityFile ~/.ssh/%h_id_rsa
        IdentitiesOnly yes
        HostKeyAlias github.com
        ProxyCommand nc github.com 22
The `ProxyCommand` hack makes a global `ControlMaster auto` still work with a `%C` based `ControlPath`, but using `Hostname github.com` should work when using something like `%n_%p_%r`.
Re:Use multiple Git SSH identities on a single computer by Macha on Thursday July 20, 2023 @08:59AM (#36799808)
Why not just use %n in the pattern (hostname as passed on the CLI rather than evaluated in the config) and then `Hostname github.com` inside the `Host` block instead of the latter two commands?
Re:Use multiple Git SSH identities on a single computer by ryan-c on Thursday July 20, 2023 @09:35AM (#36800225)
I think you may have replied while I was editing to suggest that.
Re:Use multiple Git SSH identities on a single computer by tr3ntg on Thursday July 20, 2023 @01:04PM (#36803458)
What's this github subdomain format? Is this a real url you're matching or syntax for something else like your username / org name?
Re:Use multiple Git SSH identities on a single computer by ryan-c on Thursday July 20, 2023 @05:08PM (#36806774)
It's a fake subdomain used to select the key.