Skip to content

fix(mkosi): generate volatile SSH host keys after preparation - #903

Merged
kvinwang merged 2 commits into
masterfrom
codex/fix-os-guest-ssh-host-keys
Aug 4, 2026
Merged

fix(mkosi): generate volatile SSH host keys after preparation#903
kvinwang merged 2 commits into
masterfrom
codex/fix-os-guest-ssh-host-keys

Conversation

@kvinwang

@kvinwang kvinwang commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

Prevent development images from shipping one shared SSH host private key and generate volatile host keys after the writable /etc overlay is ready.

Changes

  • Remove image-build-time SSH host keys from the mkosi artifact.
  • Add an independent ssh.service drop-in that requires and starts after dstack-prepare.service.
  • Generate missing host keys with ssh-keygen -A after dstack-prepare mounts the writable /etc overlay.
  • Preserve Debian's sshd -t validation before the daemon starts.

The mkosi development image intentionally has volatile /etc state, so these host keys are per boot. Production images do not install openssh-server.

Verification

  • The drop-in is installed under /usr/lib/systemd/system/ssh.service.d/, separate from the vendor unit.
  • git diff --check passed.

Copilot AI review requested due to automatic review settings July 31, 2026 03:02

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Base automatically changed from codex/fix-os-deterministic-package-logs to master August 4, 2026 10:25
@kvinwang
kvinwang force-pushed the codex/fix-os-guest-ssh-host-keys branch from 55d4401 to 61689af Compare August 4, 2026 10:25
@kvinwang kvinwang changed the title [STACKED on #900] fix(os): generate SSH host keys per guest fix(mkosi): generate volatile SSH host keys after preparation Aug 4, 2026
@kvinwang
kvinwang merged commit e429d7f into master Aug 4, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants