Bug 2146 - Add ability to have a ~/.ssh/config.d directory with smaller configs
Summary: Add ability to have a ~/.ssh/config.d directory with smaller configs
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 6.2p1
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-29 06:33 AEST by Hugh Davenport
Modified: 2021-04-23 15:04 AEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hugh Davenport 2013-08-29 06:33:47 AEST
I've seen forum posts about doing this as a hack in bash to allow it, but was wondering whether it would be supported as a core feature. The use case is like this.

I have several different environments, say prod/test/work2/work3/home/otherhome, and they all require entries in ~/.ssh/config, but they are independant of each other. I may share parts of that config, but it would be easier if they were all seperate files in a directory such as ~/.ssh/config.d/{prod,test,work2,work3,home,otherhome} etc, then I can just share the individual files.

I understand there may be a problem with ordering, so I would suggest that the ~/.ssh/config is loaded first, and if there is something in there (like an include(dir) directive), then loads the config.d (or other specified directory) in directory listing order.

Does this seem like a reasonable feature, I would be happy to help with development if it gets the OK from core devs that it is likely to be integrated.

Cheers,

Hugh
Comment 1 Éloi Rivard 2014-10-03 00:16:35 AEST
This would be great to have the same feature for sshd too.
Comment 2 Damien Miller 2020-01-26 00:46:05 AEDT
You can achieve this via the ssh_config Include directive
Comment 3 Damien Miller 2021-04-23 15:04:37 AEST
closing resolved bugs as of 8.6p1 release