Dmitry Katsubo
2015-Jan-10 14:10 UTC
Variable substitution in UserKnownHostsFile configuration option
Dear OpenSSH developers, Do you find it a good idea if variable substitution is implemented in UserKnownHostsFile the same way it is done for IdentityFile? In ssh_config I would like to write something like UserKnownHostsFile ~/keys/%r/known_hosts Thanks! -- With best regards, Dmitry
Daniel Kahn Gillmor
2015-Jan-16 00:46 UTC
Variable substitution in UserKnownHostsFile configuration option
On Sat 2015-01-10 09:10:38 -0500, Dmitry Katsubo wrote:> Do you find it a good idea if variable substitution is implemented in > UserKnownHostsFile the same way it is done for IdentityFile? In > ssh_config I would like to write something like > > UserKnownHostsFile ~/keys/%r/known_hosts%r is the remote username, right? so this would be useful if you wanted a different known_hosts file for example.net depending on whether you were logging in as foo at example.net or bar at example.net. is that right? if so, it seems like a pretty strange use case. can you come up with a better rationale for the variable substitution? In the abstract, it seems like a reasonable suggestion, but the specific example you're offering isn't particularly compelling. --dkg
Dmitry Katsubo
2015-Jan-18 01:24 UTC
Variable substitution in UserKnownHostsFile configuration option
On 16/01/2015 01:46, Daniel Kahn Gillmor wrote:> %r is the remote username, right? so this would be useful if you wanted > a different known_hosts file for example.net depending on whether you > were logging in as foo at example.net or bar at example.net. is that right? > if so, it seems like a pretty strange use case. can you come up with a > better rationale for the variable substitution? > > In the abstract, it seems like a reasonable suggestion, but the specific > example you're offering isn't particularly compelling.I agree, this feature usecase sounds a bit weird. In my case I am using OpenSSH compiled with Cygwin for Win32 and I need to specify in etc/ssh_config something like this: UserKnownHostsFile /cygdrive/c/Users/%u/.ssh/known_hosts Currently I can only specify the location of IdentityFile. -- With best regards, Dmitry