diskimage-builder/elements/local-config/install.d/62-ssh-key
Tim Miller b880ef9017 local-config element adds authorized_key for root:
Currently, the local-config and stackuser elements
are intertwined.  local-config installs an authorized_key
for stackuser, if the stackuser element is in use.

This change does two things:
- add authorized_key for root from local-config element,
    regardeless of whether stackuser element is in use.
- install key for stack user from stackuser element,
    only if local-config element is in use.

Change-Id: I0d07b61404119ea0650c5c0fb98d6786adcf3ca9
2013-03-05 15:52:03 -08:00

11 lines
270 B
Bash
Executable File

#!/bin/bash
# Save user SSH public key if available.
# XXX: Obviously not suitable for downloadable images.
set -e
if [ -e "/tmp/in_target.d/ssh-authorized-keys" ]; then
mkdir -p /root/.ssh
cat /tmp/in_target.d/ssh-authorized-keys >> /root/.ssh/authorized_keys
fi