1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-18 19:51:17 +00:00

nixos-container: Fix show-host-key

We don't generate ecdsa keys by default anymore, so print ed25519
instead if available.
This commit is contained in:
Eelco Dolstra 2015-09-08 15:57:04 +02:00
parent f36ea29b85
commit c904dfa87c

View file

@ -290,7 +290,8 @@ elsif ($action eq "show-ip") {
}
elsif ($action eq "show-host-key") {
my $fn = "$root/etc/ssh/ssh_host_ecdsa_key.pub";
my $fn = "$root/etc/ssh/ssh_host_ed25519_key.pub";
$fn = "$root/etc/ssh/ssh_host_ecdsa_key.pub" unless -e $fn;
exit 1 if ! -f $fn;
print read_file($fn);
}