Skip to content

Commit a7d99b6

Browse files
skulidropekclaude
andcommitted
feat(ssh): enable password auth out of the box
- PasswordAuthentication yes in sshd_config (was: no) - Default password = SSH username (dev:dev) set via chpasswd at build time - PubkeyAuthentication yes kept — authorized_keys still works if provided - WHY: users need exactly one command to connect, no key setup required - INVARIANT: sshCommand from REST API works immediately after clone/create Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent c0cef75 commit a7d99b6

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ RUN useradd -m -s /bin/bash dev
1515
# sshd runtime dir
1616
RUN mkdir -p /run/sshd
1717

18-
# Harden sshd: disable password auth and root login
18+
# sshd: password auth enabled so users can connect without key setup
1919
RUN printf "%s\n" \
20-
"PasswordAuthentication no" \
20+
"PasswordAuthentication yes" \
2121
"PermitRootLogin no" \
2222
"PubkeyAuthentication yes" \
2323
"AllowUsers dev" \
2424
> /etc/ssh/sshd_config.d/dev.conf
2525

26+
# Default password = username (works out of the box; key auth still accepted if authorized_keys provided)
27+
RUN echo "dev:dev" | chpasswd
28+
2629
# Workspace in dev home
2730
RUN mkdir -p /home/dev/app && chown -R dev:dev /home/dev
2831

packages/lib/src/core/templates/dockerfile.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,16 +205,19 @@ RUN printf "%s\\n" "${config.sshUser} ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$
205205
# sshd runtime dir
206206
RUN mkdir -p /run/sshd
207207
208-
# Harden sshd: disable password auth and root login
208+
# sshd: password auth enabled so users can connect without key setup
209209
RUN printf "%s\\n" \
210-
"PasswordAuthentication no" \
210+
"PasswordAuthentication yes" \
211211
"PermitRootLogin no" \
212212
"PubkeyAuthentication yes" \
213213
"X11Forwarding yes" \
214214
"X11UseLocalhost yes" \
215215
"PermitUserEnvironment yes" \
216216
"AllowUsers ${config.sshUser}" \
217-
> /etc/ssh/sshd_config.d/${config.sshUser}.conf`
217+
> /etc/ssh/sshd_config.d/${config.sshUser}.conf
218+
219+
# Default password = username (works out of the box; key auth still accepted if authorized_keys provided)
220+
RUN echo "${config.sshUser}:${config.sshUser}" | chpasswd`
218221

219222
const renderDockerfileWorkspace = (config: TemplateConfig): string =>
220223
`# Workspace path (supports root-level dirs like /repo)

0 commit comments

Comments
 (0)