3 ms·
You can do a bit more, even: https://rya.nc/multi-github-accts.html https://rya.nc/multi-github-accts.html Host *.github.com IdentityFile ~/.ssh/%h
by ryan-c 3y ago
You can do a bit more, even: https://rya.nc/multi-github-accts.html 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`.
- Macha 3y agoWhy 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?
- ryan-c 3y agoI think you may have replied while I was editing to suggest that.
- tr3ntg 3y agoWhat's this github subdomain format? Is this a real url you're matching or syntax for something else like your username / org name?
- ryan-c 3y agoIt's a fake subdomain used to select the key.