Don't remove empty /root/.ssh

This commit is contained in:
Disassembler 2019-03-22 10:14:02 +01:00
parent 4f72107c98
commit db81cd38b8
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499

6
_vm.sh
View File

@ -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.default.json >/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