diff options
Diffstat (limited to 'cloudinit/CloudConfig/cc_ssh.py')
-rw-r--r-- | cloudinit/CloudConfig/cc_ssh.py | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/cloudinit/CloudConfig/cc_ssh.py b/cloudinit/CloudConfig/cc_ssh.py index 07527906..7b9ba5ab 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) @@ -79,7 +68,7 @@ def apply_credentials(keys, user, disable_root): setup_user_keys(keys, user, '') if disable_root: - key_prefix = 'command="echo \'Please login as the %s user rather than root user.\';echo;sleep 10" ' % user + key_prefix = 'command="echo \'Please login as the user \\\"%s\\\" rather than the user \\\"root\\\".\';echo;sleep 10" ' % user else: key_prefix = '' |