Skip to content

Don't recommend editing /etc/ssh/sshd_config directly on Debian or derivatives #325

@cjwatson

Description

@cjwatson

For Debian and its derivatives, https://www.ssh-audit.com/hardening_guides.html has something like this in each case:

echo -e "\nHostKey /etc/ssh/ssh_host_ed25519_key\nHostKey /etc/ssh/ssh_host_rsa_key" >> /etc/ssh/sshd_config

This has two problems.

Firstly, please don't advise people to append text directly to /etc/ssh/sshd_config, as it may cause configuration file conflicts on upgrades that they'll need to resolve; you're already using /etc/ssh/sshd_config.d/ssh-audit_hardening.conf elsewhere, so you might as well do so consistently.

Secondly, in general the fewer configuration options you need to set the better, and I think these are completely unnecessary. You already ensured in a previous step that only the host keys that your guide prescribes are present, and the selection order is essentially controlled by the ordering of the client's proposal anyway. I think you can just remove this step entirely and simplify your guide.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions