Enable SSH only if any keys exist
This commit is contained in:
parent
db81cd38b8
commit
0c9c54f481
5
_vm.sh
5
_vm.sh
@ -89,14 +89,11 @@ 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 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
|
chroot /mnt newaliases
|
||||||
mkdir -p /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
|
for SERVICE in cgroups consolefont crond iptables networking nginx ntpd postfix swap urandom vmmgr; do
|
||||||
ln -s /etc/init.d/${SERVICE} /mnt/etc/runlevels/boot
|
ln -s /etc/init.d/${SERVICE} /mnt/etc/runlevels/boot
|
||||||
done
|
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
|
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 using password
|
|
||||||
sed -i 's/root::/root:!:/' /mnt/etc/shadow
|
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm -rf /mnt/root
|
rm -rf /mnt/root
|
||||||
mkdir -p /mnt/root/.ssh
|
mkdir -p /mnt/root/.ssh
|
||||||
|
2
vmmgr
2
vmmgr
@ -1 +1 @@
|
|||||||
Subproject commit 81d9bb74ee63af02e20acda532f925fab2affa0d
|
Subproject commit 2494c55493cb0d097e0e1d8a048785c88c29ab09
|
Loading…
Reference in New Issue
Block a user