From db81cd38b859e0611cc9fc0a1671c54dc38589aa Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 22 Mar 2019 10:14:02 +0100 Subject: [PATCH] Don't remove empty /root/.ssh --- _vm.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_vm.sh b/_vm.sh index 86e4bee..e6690d8 100755 --- a/_vm.sh +++ b/_vm.sh @@ -88,18 +88,18 @@ apk --no-cache add apache2-utils gettext wget https://dl.dasm.cz/_vm.tar -O - | tar xf - -C /mnt chroot /mnt apk --no-cache add bridge ca-certificates curl e2fsprogs-extra gettext iptables kbd-misc libressl lxc postfix nginx openssh-server openssh-sftp-server util-linux wireguard-virt@et wireguard-tools-wg@et acme-sh@vm vmmgr@vm chroot /mnt newaliases -mkdir -p /mnt/root/.ssh /mnt/var/log/lxc +mkdir -p /mnt/var/log/lxc for SERVICE in cgroups consolefont crond iptables networking nginx ntpd postfix sshd swap urandom vmmgr; do ln -s /etc/init.d/${SERVICE} /mnt/etc/runlevels/boot done ADMINPWD=$(htpasswd -bnBC 10 "" "${ENCPWD}" | tr -d ':\n' | sed 's/$2y/$2b/') envsubst /mnt/etc/vmmgr/config.json -# Disable root login +# Disable root login using password sed -i 's/root::/root:!:/' /mnt/etc/shadow # Cleanup rm -rf /mnt/root -mkdir /mnt/root +mkdir -p /mnt/root/.ssh # Install bootloader to MBR dd bs=440 count=1 conv=notrunc if=/mnt/usr/share/syslinux/mbr.bin of=/dev/sda