Skip to content

fix(prelaunch): v0.0.18 - stop locking root; restore busybox-safe password setup - #114

Merged
Leechael merged 1 commit into
mainfrom
fix/phala-cloud-prelaunch-0.0.18
Aug 6, 2026
Merged

fix(prelaunch): v0.0.18 - stop locking root; restore busybox-safe password setup#114
Leechael merged 1 commit into
mainfrom
fix/phala-cloud-prelaunch-0.0.18

Conversation

@Leechael

@Leechael Leechael commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Sync of the Phala Cloud default pre-launch script v0.0.18.

v0.0.17 broke dev-image SSH and boot on busybox guests (all dstack 0.5.x images share the same kirkstone busybox userland):

  • passwd -l root locks the account; dstack sshd is built without PAM, so a locked account rejects all authentication including public keys (Phala-Network/phala-cloud-monorepo#1936).
  • DSTACK_ROOT_PASSWORD with no passwd --stdin (busybox passwd has none) hit exit 1 and failed the boot.
  • head -c 32 fails: fleet busybox is built without CONFIG_FEATURE_FANCY_HEAD, and set -e kills the script.

v0.0.18:

  • Empty-password branch writes a discarded random password's SHA-512 crypt hash (openssl passwd -6) into /etc/shadow directly; falls back to leaving the password empty (v0.0.15 behavior) when openssl is absent. Never locks.
  • DSTACK_ROOT_PASSWORD branch gains the same openssl-hash fallback instead of exiting.
  • Random bytes come from dd bs=1 count=32 (the v0.0.6–v0.0.16 idiom) at both call sites.

Verified on a real dstack-dev-0.5.9 CVM (pubkey SSH, user password, and a v0.0.17 control reproducing the lockout) and in a busybox + PAM-less OpenSSH container.

SHA-256: 24d363e17b26dabdbf287588c1e1968fd7fdfef10954123b99ff6c6a837c5692

…sword setup

v0.0.17 broke dev-image SSH and boot in three ways, all tied to busybox
guests (every dstack 0.5.x image ships the same kirkstone busybox):

- 'passwd -l root' locks the account; dstack sshd is built without PAM,
  so a locked account rejects ALL authentication including public keys
  (Phala-Network/phala-cloud-monorepo#1936).
- DSTACK_ROOT_PASSWORD with no 'passwd --stdin' (busybox passwd has
  none) hit 'exit 1' and failed the boot.
- 'head -c 32' random generation fails: fleet busybox is built without
  CONFIG_FEATURE_FANCY_HEAD, and set -e kills the script.

v0.0.18:
- Empty-password branch writes a discarded random password's SHA-512
  crypt hash (openssl passwd -6) into /etc/shadow directly; falls back
  to leaving the password empty (v0.0.15 behavior) when openssl is
  absent. Never locks.
- DSTACK_ROOT_PASSWORD branch gains the same openssl-hash fallback
  instead of exiting.
- Random bytes come from 'dd bs=1 count=32' (the v0.0.6-v0.0.16 idiom)
  at both call sites.

Verified on a real dstack-dev-0.5.9 CVM (pubkey SSH, user password,
and a v0.0.17 control reproducing the lockout) and in a busybox +
PAM-less OpenSSH container.
@Leechael
Leechael merged commit 48f6610 into main Aug 6, 2026
8 of 9 checks passed
@Leechael
Leechael deleted the fix/phala-cloud-prelaunch-0.0.18 branch August 6, 2026 16:16
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.

1 participant