Skip to content

hs-uploader cannot auto-generate its SFTP key: /etc/hs-uploader/keys is read-only to the service #41

Description

@rrobinett

Found on the VM101 dasi-greenfield bring-up (2026-07-25, AC0G/T1).

Symptom: every wsprdaemon-tar ship logs

Saving key "/etc/hs-uploader/keys/id_ed25519_host" failed: Read-only file system
station ssh key auto-generation failed ... continuing without a key
WsprdaemonTarSftp: gw1/gw2 failed: Permission denied (publickey,password)
... attempting FTP fallback

so a greenfield host permanently limps on the FTP fallback. Worse, the fallback's client_upload_info.txt is built without a pubkey (generation failed), so the gateway can never auto-provision SFTP — the fallback loop is stable, not self-healing.

Cause: hs-uploader.service runs with systemd filesystem hardening (ProtectSystem) that leaves /etc/hs-uploader/keys read-only to the hsupload user, but the transport tries to ssh-keygen into that directory at first use.

Workaround applied on VM101: generated the key as root and chowned to hsupload:

ssh-keygen -q -t ed25519 -f /etc/hs-uploader/keys/id_ed25519_host -N '' -C 'hs-uploader@AC0G/T1'
chown -R hsupload:hsupload /etc/hs-uploader/keys

Proper fix options:

  1. Generate the key at manifest-write time (smd admin uploader manifest --write runs as root) — preferred, keys exist before first ship; or
  2. add ReadWritePaths=/etc/hs-uploader/keys to the unit; or
  3. move the key path under /var/lib/hs-uploader/ (already writable StateDirectory).

B4 production never hit this because its key predates the hardening/cutover.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions