# A tunnel-only sshd for reverse ssh sandbox targets.
#
# The app writes `AuthorizedKeysFile`; each key is restricted to one
# loopback port with permitlisten. Run this as a separate sshd, not as
# the host's sshd. It must share a network namespace with the app so
# 127.0.0.1:<port> is the app's loopback.

Port 2222
AddressFamily any
ListenAddress 0.0.0.0

HostKey /data/tunnel/host_ed25519
PidFile /run/sshd-tunnel.pid

AuthorizedKeysFile /data/tunnel/authorized_keys
StrictModes no
UsePAM no
UseDNS no

PasswordAuthentication no
KbdInteractiveAuthentication no
PermitRootLogin no
AllowUsers tunnel

AllowTcpForwarding remote
GatewayPorts no
PermitOpen none
PermitTunnel no
PermitTTY no
X11Forwarding no
AllowAgentForwarding no
AllowStreamLocalForwarding no
ForceCommand /bin/false

ClientAliveInterval 30
ClientAliveCountMax 3
LogLevel VERBOSE
