* Sat Apr 13 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-7.sme
- fix script to recomment keys [SME: 12612] now comments rsa, dsa, ecdsa,ed25519. dropped rsa1
This commit is contained in:
@@ -84,14 +84,15 @@ SKIP: {
|
||||
|
||||
my $db = esmith::ConfigDB->open_ro or die "Could not open config db";
|
||||
|
||||
# Recomment the key in case the SystemName or DomainName changed.
|
||||
my @change = (-f "/etc/ssh/ssh_host_key") ? ("-c", "-P", "")
|
||||
for my $typek (qw(dsa rsa ecdsa ed25519)) {
|
||||
# Recomment the key in case the SystemName or DomainName changed.
|
||||
my @change = (-f "/etc/ssh/ssh_host_${typek}_key") ? ("-c", "-P", "")
|
||||
: ("-q", "-N", "");
|
||||
|
||||
esmith::util::backgroundCommand (0,
|
||||
"/usr/bin/ssh-keygen", @change, "-t", "rsa1",
|
||||
"-f", "/etc/ssh/ssh_host_key",
|
||||
"-C", "root@" . $db->get('SystemName')->value . "." . $db->get('DomainName')->value);
|
||||
|
||||
|
||||
esmith::util::backgroundCommand (0,
|
||||
"/usr/bin/ssh-keygen", @change, "-t", "$typek",
|
||||
"-f", "/etc/ssh/ssh_host_key",
|
||||
"-C", "root@" . $db->get('SystemName')->value . "." . $db->get('DomainName')->value);
|
||||
}
|
||||
exit (0);
|
||||
|
||||
|
Reference in New Issue
Block a user