ssh/config: line 1: Bad configuration option: include

Volatil3 picture Volatil3 · Apr 12, 2017 · Viewed 19.7k times · Source

In my ~/.ssh/config I added the following:

Include /Path/to/ssh.config

And it gives error:

ssh remoteEc-2
/Users/Me/.ssh/config: line 1: Bad configuration option: include
/Users/Me/.ssh/config: terminating, 1 bad configuration options

ssh -V gives:

OpenSSH_6.9p1, LibreSSL 2.1.8

I am on OSX El-Capitan

Answer

Attie picture Attie · Apr 12, 2017

Include is not a valid option until version 7.3...

See: https://www.openssh.com/txt/release-7.3

New Features

[...]

  • ssh(1): Add an Include directive for ssh_config(5) files.

Also, see this answer.


If you can't / don't want to update, then you could collate your configuration files, using the following:

cat ${CONFIG_1} ${CONFIG_2} ${CONFIG_3} > ~/.ssh/config

You'd need to run it every time you update any of the parts...