Last active
March 28, 2017 19:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.