Skip to content

Instantly share code, notes, and snippets.

@swdunlop
Last active March 28, 2017 19:29
Show Gist options
  • Save swdunlop/6478018 to your computer and use it in GitHub Desktop.
Save swdunlop/6478018 to your computer and use it in GitHub Desktop.
Enabling SSH (and static password) at boot in a Finnix ISO for remote boot
FINNIX_VERSION ?= 108
FINNIX_URL ?= http://www.finnix.org/releases/$(FINNIX_VERSION)/finnix-$(FINNIX_VERSION).iso
FINNIX_ISO = src/finnix-$(FINNIX_VERSION).iso
SSH_ISO ?= finnix-$(FINNIX_VERSION)-ssh.iso
SSH_PASSWORD ?= applypasswordhereplease
BOOT_KERNEL ?= boot/x86/linux
BOOT_INITRD ?= boot/x86/initrd.xz
BOOT_VGA ?= normal
BOOT_OPTS ?=
BOOT_CMDLINE += initrd=$(BOOT_INITRD)
BOOT_CMDLINE += vga=$(BOOT_VGA)
BOOT_CMDLINE += sshd
BOOT_CMDLINE += sshd_password=$(SSH_PASSWORD)
BOOT_CMDLINE += $(BOOT_OPTS)
$(SSH_ISO): iso
mkisofs \
-o $(SSH_ISO) \
-b isolinux.bin \
-c boot/x86/boot.cat \
-no-emul-boot \
-boot-load-size 4 \
-boot-info-table \
iso
iso: $(FINNIX_ISO)
mkdir -p iso
7z x -y -oiso $(FINNIX_ISO)
rm -rf 'iso/[BOOT]'
printf "DEFAULT linux\nLABEL linux\nKERNEL $(BOOT_KERNEL)\nAPPEND $(BOOT_CMDLINE)\n" >iso/isolinux.cfg
$(FINNIX_ISO):
mkdir -p src
wget -o $@ $(FINNIX_URL)
clean:
rm -rf iso isolinux.cfg
@swdunlop
Copy link
Author

swdunlop commented Sep 7, 2013

Note: Finnix will cheerfully print your password on your console at boot, and the server key is generated at boot time, so you won't have a fingerprint to trust. I used this to bypass a hardware vendor's terribad PXEBOOT by using their virtual ISO functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment