From 4963f769d91461e250a720c8ba89d3571b91b8c1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sun, 29 Aug 2010 21:03:22 +0000 Subject: [PATCH] * Print the host public key on the console so that the user can obtain it securely by parsing the output of ec2-get-console-output. svn path=/nixos/trunk/; revision=23524 --- modules/virtualisation/amazon-image.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/virtualisation/amazon-image.nix b/modules/virtualisation/amazon-image.nix index 7a37a74dc69..a81f40cc759 100644 --- a/modules/virtualisation/amazon-image.nix +++ b/modules/virtualisation/amazon-image.nix @@ -108,6 +108,13 @@ with pkgs.lib; rm -f /root/key.pub fi + # Print the host public key on the console so that the user + # can obtain it securely by parsing the output of + # ec2-get-console-output. + echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----" > /dev/console + ${pkgs.openssh}/bin/ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub > /dev/console + echo "-----END SSH HOST KEY FINGERPRINTS-----" > /dev/console + echo "setting host name..." ${pkgs.nettools}/bin/hostname $(${pkgs.curl}/bin/curl http://169.254.169.254/1.0/meta-data/hostname) '';