From 8fbafbddbfbdddcb0a3e087185e432973ac73baa Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 19 Jan 2011 03:49:51 +0000 Subject: move writing of ssh key fingerprints to a separate tool This will allow this code to be called more easily elsewhere. I'm considering having the "all the way up" message contain fingerprints so that they're more or less guaranteed to get to the console where the user could see them. --- cloudinit/CloudConfig/cc_ssh.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'cloudinit/CloudConfig') diff --git a/cloudinit/CloudConfig/cc_ssh.py b/cloudinit/CloudConfig/cc_ssh.py index 07527906..682875a2 100644 --- a/cloudinit/CloudConfig/cc_ssh.py +++ b/cloudinit/CloudConfig/cc_ssh.py @@ -60,18 +60,7 @@ def handle(name,cfg,cloud,log,args): send_ssh_keys_to_console() def send_ssh_keys_to_console(): - send_keys_sh = """ - { - echo - echo "#############################################################" - echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----" - ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key.pub - ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub - echo "-----END SSH HOST KEY FINGERPRINTS-----" - echo "#############################################################" - } | logger -p user.info -s -t "ec2" - """ - subprocess.call(('sh', '-c', send_keys_sh)) + subprocess.call(('/usr/lib/cloud-init/write-ssh-key-fingerprints',)) def apply_credentials(keys, user, disable_root): keys = set(keys) -- cgit v1.2.3