Skip to content

Instantly share code, notes, and snippets.

@shiwildy
Last active July 9, 2025 06:42
Show Gist options
  • Save shiwildy/7fa3f5d1b0648cc68f20cad7012d78a5 to your computer and use it in GitHub Desktop.
Save shiwildy/7fa3f5d1b0648cc68f20cad7012d78a5 to your computer and use it in GitHub Desktop.
Rescue using Debian Live from kexec
# >> Install kexec
apt install kexec-tools -y
# >> Create dir
mkdir -p /rescue
mkdir -p /rescue/iso
# >> Download systemrescue iso
wget -O /rescue/rescue.iso 'https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/debian-live-12.11.0-amd64-standard.iso'
mount -o loop /rescue/rescue.iso /rescue/iso
# >> Load kexec
kexec -l /rescue/iso/live/vmlinuz \
--initrd=/rescue/iso/live/initrd.img \
--append="findiso=/rescue/rescue.iso boot=live toram"
# >> Boot it
kexec -e
# >> Set network
ip addr add cidr/24 dev ens3
ip link set ens3 up
ip route add default via gateway dev ens3
echo "nameserver 1.1.1.1" > /etc/resolv.conf
# >> Install openssh-server
apt install openssh-server -y
passwd user
# >> Write zero
dd if=/dev/zero of=/dev/vda bs=1M count=10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment