docs / models / 75UR9S / V0000.09.60W.Q0624 / findings

02 β€” File transfer: SFTP lane over the existing root SSH

The SFTP lane ships a static OpenSSH sftp-server (built from portable sources) with the patched dropbear in the re.installer IPK: whole-filesystem access as root over the existing ssh channel β€” no new ports, no new daemons, LAN-only. Same pattern as the HE40 and 43A6K models. Verified live including after a cold power cycle. Companion to the model README and 01-os-exploration.

1. What and why

2. Components

Path What
tools/ur9s/scripts/build_sftp_server.sh builds the static ARM sftp-server β†’ tools/ur9s/bin/
tools/ur9s/sources/ offline OpenSSH source tarball (not committed; see its README)
tools/ur9s/sftp-srvr.sh the wrapper: execs sftp-server -d /, one log line per session
tools/ur9s/scripts/build_dropbear_a7k.sh dropbear build with 3 byte patches: uid-0 shell override, /etc/shells path, SFTPSERVER_PATH
tools/ur9s/scripts/make_installer.py the IPK: bundles dropbear-root, dropbearkey, sftp-server, the wrapper

3. Build

tools/ur9s/scripts/build_dropbear_a7k.sh   # -> tools/ur9s/bin/{dropbear-root,dropbearkey}
tools/ur9s/scripts/build_sftp_server.sh    # -> tools/ur9s/bin/sftp-server

The dropbear script asserts literal counts after patching (each patched string: old 0, new 1) and refuses to build otherwise. The sftp script refuses on a bad source SHA-256 or a non-static/non-ARM result.

4. Deploy

python3 tools/ur9s/scripts/make_installer.py \
    "$(cat server/keys/tv_root_ed25519.pub)" /tmp/installer.ipk

# ship (the TV has no scp applet and no sha256sum):
ssh -p 8008 -i server/keys/tv_root_ed25519 root@<tv> \
    'cat > /APPS/installer.ipk' < /tmp/installer.ipk
ssh -p 8008 -i server/keys/tv_root_ed25519 root@<tv> 'wc -c < /APPS/installer.ipk'

# install, detached (the postinst kills the running dropbear β€” i.e. your
# own session's server β€” and restarts it):
ssh -p 8008 -i server/keys/tv_root_ed25519 root@<tv> \
    'busybox setsid sh -c "opkg remove re.installer && opkg install /APPS/installer.ipk > /APPS/.re_sshd/opkg.log 2>&1" < /dev/null'

5. Use

sftp -P 8008 -i server/keys/tv_root_ed25519 root@192.168.1.20
sftp> put local.bin /path/on/tv
sftp> get /path/on/tv/file ./local

Verified: ls / shows the filesystem root; put/get round-trips byte-identical (10 MB in ~2.6 s, ~8 MB/s); ls -l reports real owner/group.

6. Operational notes

7. Teardown

Rebuild and reinstall the pre-SFTP IPK (this repo's make_installer.py without the sftp entries, dropbear built without patch 3), or opkg remove re.installer and restore the stock binaries. ssh is unaffected either way; only the sftp subsystem fails.