sftp icon indicating copy to clipboard operation
sftp copied to clipboard

Enable sshd_config.d subfiles

Open ash211 opened this issue 2 years ago • 1 comments

Before

Previously, the atmoz/sftp docker image had an empty directory at /etc/ssh/sshd_config.d/, which I thought I could add configuration to and have it applied to sshd. (This is a common pattern for unix services).

However, the default sshd_config file included in this project does not include those subfiles, so any config files added there are not respected.

After

Now with this change, files added in this directory are applied.

Example

For example, adding a file at /etc/ssh/sshd_config.d/ancient_kex_algorithm.conf with contents like this:

## Force usage of only an ancient insecure key exchange algorithms. Some of our customers have old
## opensshd servers that use kex algorithms that are no longer enabled by default. In order to test
## compatibility with those servers, we must apply this insecure config and run an integration test that
## validates we can still connect to it when the client is configured appropriately.

# Valid values documented at https://man.openbsd.org/sshd_config.5#KexAlgorithms
# No '+' in front of the name means that we override the list to just this value. Don't append.
KexAlgorithms diffie-hellman-group1-sha1

now allows me to test an insecure KexAlgorithms mode.

It's better to do this with one file, vs store a copy of sshd_config with my tweaks, so that I can pick up any future changes to the sshd_config file coming from this repo.

ash211 avatar Jul 21 '23 21:07 ash211

Hi @atmoz , is there any chance getting this merged? This feature would be highly appretiated.

Cheers Dennis

daylicron avatar Oct 16 '25 12:10 daylicron