Revision 6363a6de
Added by Ermal LUÇI over 11 years ago
etc/sshd | ||
---|---|---|
139 | 139 |
/* mop up from a badly implemented ssh keys -> cf backup */ |
140 | 140 |
if($config['ssh']['dsa_key'] <> "") { |
141 | 141 |
unset($config['ssh']['dsa_key']); |
142 |
unset($config['ssh']['ecdsa_key']); |
|
142 | 143 |
unset($config['ssh']['rsa_key']); |
143 | 144 |
unset($config['ssh']['rsa1_key']); |
144 | 145 |
unset($config['ssh']['dsa']); |
... | ... | |
154 | 155 |
} |
155 | 156 |
|
156 | 157 |
// Check for all needed key files. If any are missing, the keys need to be regenerated. |
157 |
$files_to_check = array('ssh_host_dsa_key','ssh_host_dsa_key.pub','ssh_host_key','ssh_host_key.pub','ssh_host_rsa_key','ssh_host_rsa_key.pub'); |
|
158 |
$files_to_check = array('ssh_host_dsa_key','ssh_host_dsa_key.pub','ssh_host_key','ssh_host_key.pub','ssh_host_rsa_key','ssh_host_rsa_key.pub', 'ssh_host_ecdsa_key', ssh_host_ecdsa_key.pub');
|
|
158 | 159 |
$generate_keys = false; |
159 | 160 |
foreach ($files_to_check as $f2c) { |
160 | 161 |
if (!file_exists("/etc/ssh/{$f2c}")) { |
... | ... | |
170 | 171 |
system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa1 -N '' -f $sshConfigDir/ssh_host_key"); |
171 | 172 |
system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t rsa -N '' -f $sshConfigDir/ssh_host_rsa_key"); |
172 | 173 |
system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t dsa -N '' -f $sshConfigDir/ssh_host_dsa_key"); |
174 |
system("/usr/bin/nice -n20 /usr/bin/ssh-keygen -t ecdsa -N '' -f $sshConfigDir/ssh_host_ecdsa_key"); |
|
173 | 175 |
clear_subsystem_dirty('sshdkeys'); |
174 | 176 |
file_notice("SSH", "{$g['product_name']} has completed creating your SSH keys. SSH is now started.", "SSH Startup", ""); |
175 | 177 |
echo "Starting SSH... "; |
Also available in: Unified diff
Create even elyptic curve keys