How fahrj/reverse-ssh works
ReverseSSH is a compact SSH server for interactive remote access, command execution, SFTP, and port forwarding, usable in bind or reverse-connection mode. The operator connects with SSH or SFTP; the program parses its mode and either listens for an inbound SSH connection or dials home and creates a forwarded listener, then serves SSH sessions and their requested features. The graph includes the documented forwarding and transfer capabilities, though their internal implementations are only partly shown. Source-level detail is limited to the supplied excerpts; some feature links rely on README documentation.
Main entry points: main.go SSH server · ssh_session.go Session dispatch · core.go Dial home · ssh_session_unix.go Unix PTY shell
Components 16
Runtime and SSH
- Mode and parameters
core.go - Bind listener
core.go - SSH server
main.go - Password/key auth
core.go
Shell Sessions
- Session dispatch
ssh_session.go - Command execution
ssh_session.go - Unix PTY shell
ssh_session_unix.go - Windows PTY shell
ssh_session_windows.go
SSH Features
- SFTP subsystem
core.go - Local forwarding
main.go - Remote forwarding
main.go - Forwarded TCP handler
main.go
Reverse Connection
- Dial home
core.go - Reverse listener
core.go - Connection metadata
core.go
Other components
- SSH/SFTP operator
Connections 20
- SSH/SFTP operator → Bind listener: connects to
Readme.md - SSH/SFTP operator → SSH server: requests SSH/SFTP
Readme.md - Mode and parameters → Bind listener: selects bind mode
core.go - Mode and parameters → Dial home: selects reverse mode
core.go - Bind listener → SSH server: serves SSH
core.go - Dial home → Reverse listener: opens forwarded listener
core.go - Reverse listener → SSH server: serves SSH
core.go - SSH server → Password/key auth: configures auth
main.go - SSH server → Session dispatch: dispatches sessions
main.go - Session dispatch → Command execution: runs command
ssh_session.go - Session dispatch → Unix PTY shell: starts PTY
ssh_session.go - Session dispatch → Windows PTY shell: starts PTY
ssh_session.go - SSH server → SFTP subsystem: registers subsystem
main.go - SSH server → Local forwarding: configures callback
main.go - SSH server → Remote forwarding: configures callback
main.go - SSH server → Forwarded TCP handler: registers requests
main.go - Dial home → Connection metadata: sends metadata
core.go - SSH/SFTP operator → Local forwarding: requests forwarding
Readme.md - SSH/SFTP operator → Remote forwarding: requests forwarding
Readme.md - SSH/SFTP operator → SFTP subsystem: transfers files
Readme.md