From d014a2433ee0ac14000b0e6a29613ce246531499 Mon Sep 17 00:00:00 2001 From: Gavin Li Date: Mon, 20 Apr 2015 04:18:24 -0700 Subject: [PATCH] only copy authorized_keys if it exists --- install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 64b2aa0..eed28eb 100755 --- a/install.sh +++ b/install.sh @@ -394,9 +394,11 @@ postbootstrap_configuration() { fi # authorized_keys of root will be copied anyway - mkdir -p /archroot/root/.ssh/ - chmod 700 /archroot/root/.ssh/ - cp -p /root/.ssh/authorized_keys /archroot/root/.ssh/authorized_keys + if [ -e /root/.ssh/authorized_keys ]; then + mkdir -p /archroot/root/.ssh/ + chmod 700 /archroot/root/.ssh/ + cp -p /root/.ssh/authorized_keys /archroot/root/.ssh/authorized_keys + fi # setup machine id chroot /archroot systemd-machine-id-setup