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 02:51 UTC (5 days ago)] – fixed grammar for clarity qkbssh [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 1: Line 1:
 ====== SSH ====== ====== SSH ======
  
-Root SSH is not enabled on a stock unit. Root login is closed in the stock ''%%sshd_config%%'', and there is no published default password. There are three ways in:+Root SSH is not enabled on a stock unit. Root login is closed in the stock ''%%sshd_config%%'', and there is no published default password. There are two ways in:
  
   - A PROXdongl3 with a ''%%[TestMode]%%'' EEPROM payload and a FAT USB stick.   - A PROXdongl3 with a ''%%[TestMode]%%'' EEPROM payload and a FAT USB stick.
   - An ''%%autorun%%'' script on the internal init SD card.   - An ''%%autorun%%'' script on the internal init SD card.
-  - The serial console on the ''%%ARMcons%%'' header. 
  
-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. +
- +
-The stick alone is not enough. The PROXdongl3 EEPROM needs the ''%%[TestMode]%%'' payload: +
- +
-<code> +
-[TestMode] +
-dev=/dev/disk/by-label/MP_SD ; mp=/init/efad/mp_sd +
-mount -o noatime $dev $mp +
-[ -e $mp/autorun.sh ] && { systemctl stop init-abtproxy; sh $mp/autorun.sh; } \ +
-                      || systemctl --no-block start nx +
-</code> +
- +
-At boot the payload mounts the stick and runs ''%%autorun.sh%%'' with nx stopped and the watchdog disabled. ''%%pm3-autorun.log%%'' on the stick has the output. +
- +
-Without the EEPROM dongle, 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 79: 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 88: 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.1795402262.txt.gz · Last modified: by qkb