How openssh/openssh-portable works
Portable OpenSSH implements SSHv2 for remote login, command execution and file transfer, with client/server programs and supporting key and agent tools. The principal workflow is a user invoking ssh, establishing an SSH connection to sshd, authenticating, then using a remote session; SCP and SFTP provide file-transfer capabilities. The graph also preserves documented supporting tools and major protocol/security layers. README relationships are documented; links not established by the README or excerpts are omitted. Server internals and several tool integrations were not sampled.
Main entry points: ssh.c SSH client · sshd.c SSH server · clientloop.c Interactive client loop · sftp.c SFTP client
Components 26
User tools
- SSH client
ssh.c - SCP transfer
scp.c - SFTP client
sftp.c - Key generation
ssh-keygen.c - Host key scan
ssh-keyscan.c - Key agent
ssh-agent.c - SFTP protocol client
sftp-client.c
SSH connection
- Client connection
sshconnect.c - Client authentication
sshconnect2.c - Interactive client loop
clientloop.c - Packet transport
packet.c - SSH channels
channels.c - Client configuration
readconf.c
Identity and security
- Key exchange
kex.c - Key files
sshkey.c - Authentication options
auth-options.h - Known hosts
hostfile.h
Server services
- SSH server
sshd.c - Server authentication
sshd-auth.c - Server configuration
servconf.c - Remote session
session.c - SFTP server
sftp-server.c
Shared runtime
- SSH buffers
sshbuf.h - Reliable I/O
atomicio.h - Logging and errors
log.h
Other components
- User
Connections 27
- User → SSH client: invokes
README - User → SCP transfer: invokes
README - User → SFTP client: invokes
README - User → Key generation: invokes
README - User → Host key scan: invokes
README - User → Key agent: invokes
README - SSH client → SSH server: remote login
README - SSH client → SSH server: remote execution
README - SCP transfer → SSH server: file transfer
README - SFTP client → SSH server: file transfer
README - SSH client → Client connection: connects through
- SSH client → Client authentication: authenticates through
- SSH client → Interactive client loop: runs loop
- Client connection → Packet transport: uses transport
- Client authentication → Key exchange: negotiates keys
- SSH server → Server authentication: authenticates via
- SSH server → Server configuration: loads configuration
- SSH server → Remote session: serves sessions
- SFTP client → SFTP protocol client: uses protocol client
- SFTP protocol client → SFTP server: transfers files
- Interactive client loop → SSH channels: handles channels
clientloop.c - Interactive client loop → Known hosts: checks host keys
clientloop.c - Interactive client loop → Reliable I/O: flushes output
clientloop.c - SFTP protocol client → SSH buffers: parses messages
sftp-client.c - Server authentication → Authentication options: applies options
- Client authentication → Key files: uses keys
- SSH client → Client configuration: reads settings