Commit 4e83616c authored by Ad Schellevis's avatar Ad Schellevis

(sshd) add HostKey to sshd_config to force available hostkeys. closes...

(sshd) add HostKey to sshd_config to force available hostkeys. closes https://github.com/opnsense/core/issues/1200
parent b08d5827
...@@ -105,6 +105,9 @@ if (isset($sshcfg['passwordauth'])) { ...@@ -105,6 +105,9 @@ if (isset($sshcfg['passwordauth'])) {
$sshconf .= "ChallengeResponseAuthentication no\n"; $sshconf .= "ChallengeResponseAuthentication no\n";
$sshconf .= "PasswordAuthentication no\n"; $sshconf .= "PasswordAuthentication no\n";
} }
foreach ($keys as $key) {
$sshconf .= "HostKey {$etc_ssh}/{$key}\n";
}
/* Write the new sshd config file */ /* Write the new sshd config file */
file_put_contents("{$etc_ssh}/sshd_config", $sshconf); file_put_contents("{$etc_ssh}/sshd_config", $sshconf);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment