ssh-ident icon indicating copy to clipboard operation
ssh-ident copied to clipboard

An option for specifying global SSH options

Open s1kx opened this issue 8 years ago • 1 comments

In addition to SSH_DEFAULT_OPTIONS, there should also be an option SSH_GLOBAL_OPTIONS and/or a way to merge the identity config file with a global ssh config (e.g. ~/.ssh/config).

This is necessary to separate global options (such as UseRoaming/ServerAliveInterval/ServerAliveCountMax) from default options, which are semantically different and could be easy to confuse with one another. That's not to mention that repeating the same options for 10 identities is unidiomatic and prone to errors.

This issue especially affects users that use identity-specific configs, as otherwise you could simply place your global options in a Host * block in ~/.ssh/config.

One idiomatic way of solving this would be to create an ephemeral file to be used as the -F <config> argument. ssh-ident could append ~/.ssh/identities/%i/config and ~/.ssh/config to a new file (e.g. ~/.ssh/session-configs/%i) and pass that config file to ssh with -F. In order to make sure the file is up to date, it could use the timestamps of the identity config, the global config and compare it to the session-config to determine if it needs to be regenerated.

s1kx avatar Aug 25 '16 00:08 s1kx

Have a look at my fork at https://github.com/maddes-b/ssh-ident There I extended SSH_OPTIONS to specify parameters per identiy and/or binary.

maddes-b avatar Jan 23 '21 21:01 maddes-b