SSH: Bad configuration option: usekeychain

SSH: bad configuration option - usekeychain SSH bad configuration option: usekeychain

I’m merging my ssh client configuration so that it can be shared between my laptops and desktop. The benefit is obvious: only one place where new hostname entries and SSH options need to be added! But there’s also an issue: Linux and macOS implementations of OpenSSH are different, and not every option exists in both operating systems.

SSH config: bad configuration option: usekeychain

I got this error when I attempted to use the .ssh/config file from macOS on my laptop with LMDE4:

greys@xps:~ $ ssh mcfly
/home/greys/.ssh/config: line 14: Bad configuration option: usekeychain
/home/greys/.ssh/config: terminating, 1 bad configuration options

Because this option is a generic one I have at the very top of my .ssh/config file, it means I can’t connect anywhere until I fix or comment this “UseKeychain yes” option.

Luckily, there’s a simple enough fix: just add the IgnoreUnknown directive into .ssh/config right above the “UseKeychain yes” and it will be ignored on Linux systems. On macOS it will still keep working as intended.

Here’s how the updated fragment of .ssh/config should look:

IgnoreUnknown UseKeychain
UseKeychain yes

That’s it for today. Will share more once I progress with this enough.

See Also




Keep Learning

Follow me on Facebook, Twitter or Telegram:
Recommended
I learn with Educative: Educative
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets