From dd367bdf9b1714664b74e134593bf3e5d662c211 Mon Sep 17 00:00:00 2001 From: Zhuoyun Wei Date: Sun, 19 Apr 2015 00:11:35 +0800 Subject: [PATCH] Copy authorized_keys of root If a droplet was created with SSH keys preloaded, there will be no root password so `ssh root@new_arch_droplet` will no work. It is better to copy `/root/.ssh/authorized_keys` file no matter user chooses to preserve home directories or not. --- install.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/install.sh b/install.sh index c4d8aa8..64b2aa0 100755 --- a/install.sh +++ b/install.sh @@ -392,6 +392,11 @@ postbootstrap_configuration() { rm -rf /archroot/{home,root} cp -al /{home,root} /archroot/ 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 # setup machine id chroot /archroot systemd-machine-id-setup