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:
1 parent
b33b52e7a9
commit
83be6c6309
4 files changed
+10
-7
No files matched your search
@@ -2,8 +2,11 @@ FROM alpine:3.22
|
|||||||
|
|
||||||
RUN apk add --no-cache openssh tailscale
|
RUN apk add --no-cache openssh tailscale
|
||||||
|
|
||||||
# Low-privilege login account; nologin shell — sessions exist only to forward.
|
# Low-privilege login account, key-only. ash shell so interactive jump
|
||||||
RUN adduser -D -H -s /sbin/nologin bridge
|
# 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 sshd_config /etc/ssh/sshd_config
|
||||||
COPY run.sh /run.sh
|
COPY run.sh /run.sh
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ yellow:2223 (LAN/WAN), then jumps to tailnet hosts or opens a SOCKS proxy
|
|||||||
## What it deliberately does NOT do
|
## What it deliberately does NOT do
|
||||||
- No advertise_routes, no exit node → the bridge exposes zero LAN to the tailnet.
|
- 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 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!)
|
## Tailscale ACL additions (merge into existing policy — review current first!)
|
||||||
Default Tailscale policy is allow-all; if the tailnet already has custom rules,
|
Default Tailscale policy is allow-all; if the tailnet already has custom rules,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name: "SSH Bridge (Tailscale)"
|
name: "SSH Bridge (Tailscale)"
|
||||||
version: "1.0.3"
|
version: "1.0.4"
|
||||||
slug: "ssh_bridge"
|
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."
|
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"
|
url: "https://git.halfast.com/hermes/ha-addons"
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ ListenAddress 0.0.0.0
|
|||||||
HostKey /data/ssh/ssh_host_ed25519_key
|
HostKey /data/ssh/ssh_host_ed25519_key
|
||||||
|
|
||||||
# Hard limits
|
# Hard limits
|
||||||
UsePAM no
|
# (No UsePAM here: Alpine's OpenSSH is built without PAM and rejects the
|
||||||
# (Alpine's PAM rejects passwordless accounts as "locked" before key auth is
|
# option. The "account is locked" check is OpenSSH's own; the bridge account
|
||||||
# tried; this container has no PAM-dependent needs — key-only by design.)
|
# is unlocked in the Dockerfile instead.)
|
||||||
PermitRootLogin no
|
PermitRootLogin no
|
||||||
PasswordAuthentication no
|
PasswordAuthentication no
|
||||||
KbdInteractiveAuthentication no
|
KbdInteractiveAuthentication no
|
||||||
|
|||||||
Reference in new issue
Block a user