From ae4750868c4d79ed74393b73447b2d1e643b0533 Mon Sep 17 00:00:00 2001 From: Bruce Toll <4109762+tollb@users.noreply.github.com> Date: Sat, 15 Mar 2025 13:16:03 -0400 Subject: [PATCH] nixos/ec2-data fix host fingerprint output to console (regression) PR #322282 introduced a regression that causes the previous display of the ssh host key fingerprints to get directed to the journal rather than the console (as intended). Thus, the console only logs an empty set of fingerprints: -----BEGIN SSH HOST KEY FINGERPRINTS----- -----END SSH HOST KEY FINGERPRINTS----- The fix is to reorder the bash statement that invokes ssh-keygen so that the ssh-keygen output is directed to /dev/console. --- nixos/modules/virtualisation/ec2-data.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/virtualisation/ec2-data.nix b/nixos/modules/virtualisation/ec2-data.nix index e3df23dfff6a..84508da0c5a0 100644 --- a/nixos/modules/virtualisation/ec2-data.nix +++ b/nixos/modules/virtualisation/ec2-data.nix @@ -87,7 +87,7 @@ with lib; # ec2-get-console-output. echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----" > /dev/console for i in /etc/ssh/ssh_host_*_key.pub; do - ${config.programs.ssh.package}/bin/ssh-keygen -l -f "$i" || true > /dev/console + ${config.programs.ssh.package}/bin/ssh-keygen -l -f "$i" > /dev/console || true done echo "-----END SSH HOST KEY FINGERPRINTS-----" > /dev/console '';