* 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:
@@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user