Re: [PATCH] GIT_SSH alternate ssh name or helper
From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:03
Martin Sivak [off-list ref] writes:
I mean, how would you setup different identities for more user accounts on the same server (it doesn't happen often, but..)?
I do not claim the way I do is the best way, but I do that all
the time.
I just use different "name" to connect, by setting up the ssh
client configuration file to give me the protocol parameters I
want depending on the name I use. The wildcard support handles
permutations quite nicely. Something like this:
$ cat .ssh/config
Host *-1-*
Protocol 1
Host *-2-*
Protocol 2
Host lucia-*
Hostname lucia.example.xz
Host myriam-*
Hostname myriam.example.xz
Host *-junio
IdentityFile ~/.ssh/identity-junio
IdentityFile ~/.ssh/id_dsa-junio
Host *-junkio
IdentityFile ~/.ssh/identity-junkio
IdentityFile ~/.ssh/id_dsa-junkio
$ ssh lucia-2-junio ;# go to lucia over protocol 2, use id_dsa-junio
$ ssh myriam-1-junkio ;# to myriam over protocol 1, use identity-junkio