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-01-15 23:05 UTC (11 months ago)] – Fixed display issue of script extrapicklesssh [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:
-You can get root ssh on the device relatively easily by remounting the filesystem read-write and modifying /etc/ssh/sshd_config to point to your keys.+====== 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 two ways in: 
 + 
 +  - A PROXdongl3 with a ''%%[TestMode]%%'' EEPROM payload and a FAT USB stick. 
 +  - An ''%%autorun%%'' script on the internal init SD card. 
 + 
 +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:
  
-Placing something like the following in `/autorun/95-enable-ssh.sh` on the SD card should work, making sure to modify the `echo "your keys"` line. 
 <code bash> <code bash>
 #!/bin/sh #!/bin/sh
 +HERE=$(cd "$(dirname "$0")" && pwd)
 mount -o remount,rw / mount -o remount,rw /
  
-echo "Port 22" > /etc/ssh/sshd_config +[ -f /etc/ssh/sshd_config.stock ] || cp /etc/ssh/sshd_config /etc/ssh/sshd_config.stock
-echo "PermitRootLogin yes" >> /etc/ssh/sshd_config +
-echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config +
-echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config+
  
-mkdir -p /root/.ssh +{ 
-echo "your keys" > /root/.ssh/authorized_keys +  echo "Port 22" 
-chmod  0700 /root/.ssh +  echo "PermitRootLogin yes" 
- +  echo "PubkeyAuthentication yes" 
-systemctl enable --now sshd.socket+  echo "AuthorizedKeysFile .ssh/authorized_keys" 
 +  echo "Subsystem sftp internal-sftp" 
 +} > /etc/ssh/sshd_config
  
 +mkdir -p /root/.ssh
 +cat "$HERE/authorized_keys" > /root/.ssh/authorized_keys
 +chmod 0700 /root/.ssh
 +chmod 0600 /root/.ssh/authorized_keys
 +systemctl enable sshd.socket
 +systemctl restart sshd.socket
 mount -o remount,ro / mount -o remount,ro /
 </code> </code>
  
 +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 =====
 +
 +The device has an old OpenSSH. Use legacy scp mode:
 +
 +<code>
 +scp -O file root@<unit-ip>:/tmp/
 +</code>
  
ssh.1768518312.txt.gz · Last modified: by extrapickles