Volatil3
Volatil3

Reputation: 14988

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

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

Upvotes: 20

Views: 46326

Answers (2)

ᴍᴇʜᴏᴠ
ᴍᴇʜᴏᴠ

Reputation: 5256

Same problem, except I'm on 7.4

Turns out, the Include directive needs to go into /etc/ssh/ssh_config, not /etc/ssh/sshd_config (note the d in the filename).

Wasn't obvious to me. Hope this saves whoever finds this some time.

Upvotes: 10

Attie
Attie

Reputation: 6979

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...

Upvotes: 21

Related Questions