cloud-init/tools/write-ssh-key-fingerprints
Scott Moser ed280d0e95 Make the types of SSH keys to generate configurable
Notes:
 * This also makes cc_ssh.py *not* write ssh keys to the console.
   That means that if keys-to-console is configured off, nothing will
   write the keys to the console.
 * I removed Garret's use of xargs, replacing with a shell for loop
   in write-ssh-key-fingerprints.

taken from
git://pkgs.fedoraproject.org/cloud-init.git
commit 87f33190f43d2b26cced4597e7298835024466c2
Author: Garrett Holmstrom <gholms@fedoraproject.org>
Patch8: cloud-init-0.6.2-sshkeytypes.patch
2011-10-30 18:00:41 -04:00

13 lines
386 B
Bash
Executable File

#!/bin/sh
{
echo
echo "#############################################################"
echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----"
for f in /etc/ssh/ssh_host_*key.pub; do
[ -f "$f" ] || continue
ssh-keygen -l -f "$f"
done
echo "-----END SSH HOST KEY FINGERPRINTS-----"
echo "#############################################################"
} | logger -p user.info -s -t "ec2"