(sshd) add HostKey to sshd_config to force available hostkeys. closes https://github.com/opnsense/core/issues/1200

This commit is contained in:
Ad Schellevis 2016-09-25 19:04:45 +02:00
parent b08d58270e
commit 4e83616c7e

View File

@ -105,6 +105,9 @@ if (isset($sshcfg['passwordauth'])) {
$sshconf .= "ChallengeResponseAuthentication no\n";
$sshconf .= "PasswordAuthentication no\n";
}
foreach ($keys as $key) {
$sshconf .= "HostKey {$etc_ssh}/{$key}\n";
}
/* Write the new sshd config file */
file_put_contents("{$etc_ssh}/sshd_config", $sshconf);