ssh_config
ssh_config copied to clipboard
Add canonically-cased config options
This PR adds a list of config options pulled from https://man.openbsd.org/ssh_config (an example function to re-pull the list is included as well, commented out), and adds a KV.CanonicalKey() function, such that when printed with String(), the proper case is used for the Key, rather than all lowercase.
Example:
Host ssh.github.com gist.github.com github.com github
Hostname ssh.github.com
IdentitiesOnly yes
IdentityFile ~/.ssh/id_ed25519
User git
Without this, when manssh l prints:
gist.github.com -> [email protected]:22
identitiesonly = yes
identityfile = ~/.ssh/id_ed25519
github -> [email protected]:22
identitiesonly = yes
identityfile = ~/.ssh/id_ed25519
github.com -> [email protected]:22
identitiesonly = yes
identityfile = ~/.ssh/id_ed25519
github.me -> [email protected]:22
identitiesonly = yes
identityfile = ~/.ssh/id_ed25519
ssh.github.com -> [email protected]:22
identitiesonly = yes
identityfile = ~/.ssh/id_ed25519
the ~/.ssh/config file is also modified:
Host ssh.github.com gist.github.com github.com github
hostname ssh.github.com
identitiesonly yes
identityfile ~/.ssh/id_ed25519
user git
With this change, the case is preserved in the file.
Thanks for this. Can I ask how you found this library? Or what underlying use case you ran into?