I synchronise my .ssh/config file between (most of) my laptops, including some Linux and macOS ones. On Mac, it’s quite nice to be able to use the UseKeychain option to store SSH passphrases in the secure keychain thing.. until you then try to use the same config file on Linux that is..!

Thankfully, the IgnoreUnknown option can be used to tell Linux to stop whining about a bad configuration option, like so:

Host [heheh no]
    User theresnotime
    IdentityFile ~/.ssh/keys/path/to/key
    AddKeysToAgent yes
    IgnoreUnknown UseKeychain
    UseKeychain yes

However, Linux (Is it a Debian thing? Is it an OpenSSH thing? Who knows…) sometimes decides to ignore the inline IgnoreUnknown UseKeychain and instead present the error SSH: Bad configuration option: usekeychain for fun or something.

This tends to occur just as I’m urgently having to SSH into something, so my solution is to edit .ssh/config and remove the UseKeychain lines in a huff.


Host *
    IgnoreUnknown UseKeychain

to the top of .ssh/config seems to have fixed that, as sorta suggested by https://www.unixtutorial.org/ssh-bad-configuration-option-usekeychain :-)

The more you know, etc.