* Tue Nov 12 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-10.sme

- fix update of host keys comment [SME: 12759]
This commit is contained in:
2024-11-12 12:48:20 -05:00
parent fe19270a45
commit 7a00907a30
3 changed files with 7 additions and 700 deletions

View File

@@ -83,6 +83,7 @@ SKIP: {
=cut
my $db = esmith::ConfigDB->open_ro or die "Could not open config db";
my $comment = "root@" . $db->get('SystemName')->value . "." . $db->get('DomainName')->value;
for my $typek (qw(dsa rsa ecdsa ed25519)) {
# Recomment the key in case the SystemName or DomainName changed.
@@ -91,8 +92,8 @@ for my $typek (qw(dsa rsa ecdsa ed25519)) {
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);
"-f", "/etc/ssh/ssh_host_${typek}_key",
"-C", "comment");
}
exit (0);