User Tools

Site Tools


ssh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ssh [2026-11-23 04:12 UTC (5 days ago)] – rm dongle payload exposition (tangential, and does not match actual PROXdongl3 payload) doofssh [2026-11-23 04:14 UTC (5 days ago)] (current) – suggest manual stick creation as default (our audience is sophisticated enough to format a USB stick manually; less is more), and offer make_dongle.py as alternative doof
Line 6: Line 6:
   - An ''%%autorun%%'' script on the internal init SD card.   - An ''%%autorun%%'' script on the internal init SD card.
  
-The USB route is the easiest. From a checkout of the [[https://github.com/imjustafox/proxmobil3-toolkit|toolkit linked here]], [[https://github.com/imjustafox/proxmobil3-toolkit/blob/main/make_dongle.py|make_dongle.py]] builds the stick: MBR, one FAT32 partition labeled ''%%MP_SD%%'', ''%%usb/autorun.sh%%'', a public key as ''%%authorized_keys%%'', and a ''%%pm3-nodump%%'' marker. +The USB route is the easiest. Format your USB stick FAT32 (MBR) and copy your ''authorized_keys'' file and the following ''autorun.sh'' script to its root:
- +
-<code> +
-./make_dongle.py +
-</code> +
- +
-With no arguments it lists removable disks and keys. The non-interactive form: +
- +
-<code> +
-./make_dongle.py --device disk4 --key ~/.ssh/id_ed25519.pub +
-</code> +
- +
-''%%--github <user>%%'' pulls ''%%github.com/<user>.keys%%'', ''%%--key-url%%'' takes an ''.pub'' URL, ''%%--autodump%%'' builds the capture variant, and ''%%--dry-run%%'' shows the plan. It will not touch the system disk and asks for the device name before erasing. It needs Python 3; on Linux it also needs ''%%parted%%'', ''%%mkfs.vfat%%'' from dosfstools, and ''%%lsblk%%''/''%%partprobe%%''/''%%udevadm%%'' from util-linux. +
- +
-By hand, the same stick is: +
- +
-<code> +
-diskutil eraseDisk FAT32 MP_SD MBRFormat /dev/diskN          # macOS +
- +
-sudo parted -s /dev/sdX mklabel msdos                        # Linux +
-sudo parted -s /dev/sdX mkpart primary fat32 1MiB 100% +
-sudo mkfs.vfat -F 32 -n MP_SD /dev/sdX1 +
- +
-cp usb/autorun.sh /Volumes/MP_SD/autorun.sh +
-cp ~/.ssh/id_ed25519.pub /Volumes/MP_SD/authorized_keys +
-</code> +
- +
-The one MBR partition matters. The unit mounts partition 1, and a default GPT layout makes that an empty EFI partition, so the payload never finds the script. +
- +
-Without a PROXdongl3, put the same script on the init SD card as ''%%/init/autorun/95-enable-ssh.sh%%''. The autorun directory runs at boot in filename order. +
- +
-===== Access script (init SD) ===== +
- +
-Put a public key next to the script as ''%%authorized_keys%%''. This is the init SD version; the USB version in ''%%usb/autorun.sh%%'' also turns the watchdog off and logs to ''%%pm3-autorun.log%%''. It backs up the stock SSH config, installs the key, and leaves the root filesystem read-only again.+
  
 <code bash> <code bash>
Line 66: Line 33:
  
 The stock config is saved as ''%%/etc/ssh/sshd_config.stock%%''. To return a unit to stock, restore that file, remove ''%%/root/.ssh/authorized_keys%%'', disable ''%%sshd.socket%%'', and remount ''%%/%%'' read-only. The stock config is saved as ''%%/etc/ssh/sshd_config.stock%%''. To return a unit to stock, restore that file, remove ''%%/root/.ssh/authorized_keys%%'', disable ''%%sshd.socket%%'', and remount ''%%/%%'' read-only.
 +
 +A [[https://github.com/imjustafox/proxmobil3-toolkit/blob/main/make_dongle.py|make_dongle.py]] script is available that can help construct a USB stick.
  
 ===== Copying files ===== ===== Copying files =====
Line 75: Line 44:
 </code> </code>
  
-===== Watchdog ====== 
- 
-nx feeds the PIC32 watchdog. If the script leaves nx stopped, add NxExe watchdog 0; the stock [TestMode] path already does. See [pic32] and [nx]. 
-<code> 
-NxExe watchdog 0 
-</code> 
- 
-The stock ''%%[TestMode]%%'' path already does this before running the script. 
ssh.1795407144.txt.gz · Last modified: by doof