← Back to context

Comment by eapriv

3 months ago

Of course the order matters, that’s why the file names have numbers in them.

I think their surprise comes from earlier config wins conflicts, rather than the other way around. That's not reflected in the title.

I initially read "the order of files in /etc/ssh/sshd_config.d/" to mean the order of files in the underlying directory inode, i.e. as returned by `ls -f` — and thought, "oh god"... But the lexicographical order, that's not too surprising.

yeah, this is confdir 101...

but i guess learning is better late than never type of thing.

also what confuses people more on this is that openssh is properly designed, so configs are first seen wins. exactly so that file 0_ wins from 99_... but most people see badly designed software where 99_ overrides 0_. openssh way is exactly so it works best with confir or ssh/options where it matches by hosts and you can place the more important stuff first without fear defaults will override it.