mkimage-profiles/features.in/vm-ssh/generate.mk
Michael Shigorin 09be84beee initial vm-{net,ssh} features
A virtual machine isn't very useful if there are no means
to access it; let's bring up the basic networking and provide
root SSH access via pre-existing public key.

As the remote access with known default credentials is roughly
equivalent to just lending one's VMs to anyone with network
access to it, the fallback root password is now exterminated;
you have to provide one (or a long enough random string
if you plan to use keys only, see e.g. apg utility).
2012-06-25 19:29:38 +03:00

13 lines
274 B
Makefile

ifdef BUILDDIR
include $(BUILDDIR)/distcfg.mk
# prepare the provided public SSH key to be carried over into the VM image
all: SSH_DIR = $(BUILDDIR)/files/root/.ssh
all:
@if [ -s "$(SSH_KEY)" ]; then \
install -pD "$(SSH_KEY)" "$(SSH_DIR)/authorized_keys"; \
fi
endif