stribika.github.io
stribika.github.io copied to clipboard
HostKeyAlgorithms should also be set in sshd_config
Issue
Section Client authentication advises to add
HostKeyAlgorithms [email protected],[email protected],ssh-ed25519,ssh-rsa
to section Host * of /etc/ssh/ssh_config.
At least in OpenSuse Leap 15.3 the command
systemctl restart sshd.service
triggers
ssh-keygen -A
(for good or for bad) and those deleted keys are recreated.
man sshd_config
[...]
HostKey
[...]
Note that [...] that the HostKeyAlgorithms option restricts which of the keys are actually used by sshd(8).
[...]
Proposal
Add
HostKeyAlgorithms [email protected],[email protected],ssh-ed25519,ssh-rsa
to /etc/ssh/sshd_config as well.
Hello, I came across this issue ticket by searching for Terrapin attack.
Setting HostKeyAlgorithms is not recommended by the OpenSSH devs, because this can lead to more mitm warnings. this was discussed with CVE-2020-14145 (ssh fingerprint information leak):
- https://bugzilla.mindrot.org/show_bug.cgi?id=3313
- https://docs.ssh-mitm.at/vulnerabilities/CVE-2020-14145.html