forked from vhaudiquet/rhema-together
feat: add reverse ssh sandbox targets
A sandbox behind NAT could not reach the room. A reverse target dials a tunnel-only sshd on the server, forwards localhost:22 to a loopback port, and the worker connects there. The server assigns the port and writes one authorized_keys line per tunnel target. The key carries permitlisten for that port; the sshd allows remote forwarding only, with no shell or local forwarding. The tunnel private key is shown once and never stored; rotating it rewrites the file. The target list and setup dialog carry the command, and the docs include the sshd config and sidecar requirements.
This commit is contained in:
1 parent
fc684115b5
commit
d85f68a176
20 files changed
+893
-38
No files matched your search
@@ -0,0 +1,37 @@
|
||||
# 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
|
||||
Reference in new issue
Block a user