ssh-bridge 1.0.4: Alpine openssh has no PAM (UsePAM invalid); unlock bridge in shadow + give it ash shell for interactive jumps

This commit is contained in:
Hermes Sysadmin committed 2026-11-19 23:54:08 +00:00
1 parent b33b52e7a9
commit 83be6c6309
4 files changed
+10 -7

No files matched your search

+5 -2
View File
@@ -2,8 +2,11 @@ FROM alpine:3.22
RUN apk add --no-cache openssh tailscale
# Low-privilege login account; nologin shell — sessions exist only to forward.
RUN adduser -D -H -s /sbin/nologin bridge
# Low-privilege login account, key-only. ash shell so interactive jump
# sessions (ssh bridge@... then ssh onward) work; -D leaves shadow "!"
# (locked) which OpenSSH rejects even for pubkey auth, so unlock it.
# Password auth stays off in sshd_config, so an empty password field is inert.
RUN adduser -D -H -s /bin/ash bridge && passwd -u bridge
COPY sshd_config /etc/ssh/sshd_config
COPY run.sh /run.sh
+1 -1
View File
@@ -30,7 +30,7 @@ yellow:2223 (LAN/WAN), then jumps to tailnet hosts or opens a SOCKS proxy
## What it deliberately does NOT do
- No advertise_routes, no exit node → the bridge exposes zero LAN to the tailnet.
- No hassio_api/homeassistant_api → cannot reach HA even from inside the container.
- No password auth, no root login, nologin shell user.
- No password auth, no root login. Key-only ash user for jump sessions.
## Tailscale ACL additions (merge into existing policy — review current first!)
Default Tailscale policy is allow-all; if the tailnet already has custom rules,
+1 -1
View File
@@ -1,5 +1,5 @@
name: "SSH Bridge (Tailscale)"
version: "1.0.3"
version: "1.0.4"
slug: "ssh_bridge"
description: "Contained tailscale+sshd jump host for tailnet access. Runs in its own network namespace; Home Assistant and the host itself do NOT join the tailnet."
url: "https://git.halfast.com/hermes/ha-addons"
+3 -3
View File
@@ -5,9 +5,9 @@ ListenAddress 0.0.0.0
HostKey /data/ssh/ssh_host_ed25519_key
# Hard limits
UsePAM no
# (Alpine's PAM rejects passwordless accounts as "locked" before key auth is
# tried; this container has no PAM-dependent needs — key-only by design.)
# (No UsePAM here: Alpine's OpenSSH is built without PAM and rejects the
# option. The "account is locked" check is OpenSSH's own; the bridge account
# is unlocked in the Dockerfile instead.)
PermitRootLogin no
PasswordAuthentication no
KbdInteractiveAuthentication no