saltstack-formulas / openssh-formula

http://docs.saltstack.com/en/latest/topics/development/conventions/formulas.html
Other
90 stars 297 forks source link

[BUG] ssh_config multiple IdentityFile not supported #176

Open mlrtime opened 4 years ago

mlrtime commented 4 years ago

In my pillar I have

IdentityFile: - ~/.ssh/id_rsa - ~/.ssh/id_ed25519 - ~/.ssh/id_ecdsa

This Renders to:

Host *IdentityFile ~/.ssh/id_rsaIdentityFile ~/.ssh/id_ed25519IdentityFile ~/.ssh/id_ecdsa

It seems that ssh_config does not support multiple IdentityFile

myii commented 4 years ago

@mlrtime Thanks for the report. Would you mind linking to the upstream OpenSSH documentation, showing us how this feature is supposed to be supported? The fix can then be linked back to the original sources, explaining why the change has been made.

mlrtime commented 4 years ago

From: https://linux.die.net/man/5/ssh_config

IdentityFile Specifies a file from which the user's RSA or DSA authentication identity is read. The default is ~/.ssh/identity for protocol version 1, and ~/.ssh/id_rsa and ~/.ssh/id_dsa for protocol version 2. Additionally, any identities represented by the authentication agent will be used for authentication.

The file name may use the tilde syntax to refer to a user's home directory or one of the following escape characters: '%d' (local user's home directory), '%u' (local user name), '%l' (local host name), '%h' (remote host name) or '%r' (remote user name).

It is possible to have multiple identity files specified in configuration files; all these identities will be tried in sequence.

myii commented 4 years ago

@mlrtime Thanks. Can you put that into an actual example of what should be rendered in the file itself?

mlrtime commented 4 years ago

IdentityFile ~/.ssh/identity IdentityFile ~/.ssh/id_rsa IdentityFile ~/.ssh/id_dsa