Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornelicorn committed Dec 14, 2023
0 parents commit ddbf748
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/image
/image.tar
/mkosi.cache
/mkosi.rootpw
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Reimage any VPS without KVM access

```bash
mkosi build
rsync -zP image.tar root@ip:/root/
ssh root@<ip>
mkdir -p /run/nextroot
cd /run/nextroot
tar -xf /local_scratch/image.tar
cp /etc/ssh/ssh_host_* etc/ssh/
systemctl soft-reboot
ssh root@<ip>
cryptsetup close root # Close old root cryptsetup mapper if you have that
# Repartition hard drive and install your system
```
28 changes: 28 additions & 0 deletions mkosi.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[Distribution]
Distribution=debian
Release=sid

[Content]
Timezone=UTC
Packages=
systemd
dbus
udev
bash
dpkg
apt
apt-transport-https
ca-certificates
openssh-server
util-linux
util-linux-extra
systemd-resolved
parted
gdisk
fdisk
cryptsetup
mkosi


[Output]
@Format=tar
1 change: 1 addition & 0 deletions mkosi.extra/etc/ssh/sshd_config.d/10-allow-root-pw.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PermitRootLogin yes
6 changes: 6 additions & 0 deletions mkosi.extra/etc/systemd/network/01-default.network
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[Match]
Name=enp*

[Network]
DHCP=yes

4 changes: 4 additions & 0 deletions mkosi.extra/etc/systemd/system-preset/01default.preset
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enable systemd-resolved.service
enable ssh.service
enable sshd.service
enable systemd-networkd.service

0 comments on commit ddbf748

Please sign in to comment.