RFC 4253 — SSH Transport Layer
The Secure Shell (SSH) Transport Layer Protocol — provides server authentication, confidentiality, and integrity for remote access. Foundation of SSH used for secure system administration.
1. Introduction
▶The SSH Transport Layer Protocol provides server host authentication, encryption, and integrity protection over an insecure network. It is the foundation for SSH — the most widely used protocol for secure remote system administration.
ISO 27001 Relevance: A.8.20 (Network Security) — encrypted remote access channel. A.8.5 (Secure Authentication) — host key verification and algorithm negotiation. A.8.2 (Privileged Access) — SSH is the primary protocol for administrative access to servers.
2. Protocol Layers
▶┌──────────────────────────┐ │ Connection Protocol │ Channels, port forwarding │ (RFC 4254) │ ├──────────────────────────┤ │ User Authentication │ Password, publickey, keyboard-interactive │ (RFC 4252) │ ├──────────────────────────┤ │ Transport Layer │ Key exchange, encryption, integrity, compression │ (RFC 4253 — this doc) │ ├──────────────────────────┤ │ TCP │ Port 22 └──────────────────────────┘
3. Key Exchange
▶SSH key exchange establishes shared secrets for encryption and integrity:
| Algorithm | Status | ISO A.8.24 |
|---|---|---|
| curve25519-sha256 | RECOMMENDED | Strong — modern |
| ecdh-sha2-nistp256 | REQUIRED | Strong |
| diffie-hellman-group16-sha512 | RECOMMENDED | Strong (4096-bit) |
| diffie-hellman-group14-sha256 | REQUIRED | Minimum acceptable |
| diffie-hellman-group1-sha1 | HISTORIC | MUST NOT use |
4. Host Key Verification
▶- First connection: Client verifies server's host key against known_hosts or out-of-band fingerprint
- Trust-on-first-use (TOFU): Common but vulnerable to MITM on initial connection
- Certificate-based: SSH certificates (ssh-keygen -s) provide CA-based host verification — RECOMMENDED for enterprise (A.8.24)
- SSHFP DNS: Host key fingerprints published in DNS with DNSSEC validation (RFC 4255)
5. Encryption & MAC
▶| Cipher | Status | Notes |
|---|---|---|
| chacha20-poly1305@openssh.com | RECOMMENDED | AEAD — no separate MAC needed |
| aes256-gcm@openssh.com | RECOMMENDED | AEAD — AES-GCM |
| aes256-ctr | REQUIRED | Needs separate MAC |
| aes128-cbc | DEPRECATED | CBC mode vulnerable to plaintext recovery |
| 3des-cbc | HISTORIC | MUST NOT use |
6. Security Considerations
▶- Disable password auth: Use public key or certificate authentication only (A.8.5)
- Key rotation: Rotate host keys and user keys periodically
- Bastion hosts: Use SSH jump hosts (ProxyJump) for defense-in-depth access to internal systems
- Agent forwarding: Use with caution — compromised intermediate host can use forwarded agent
- Logging: Log all SSH sessions including commands for audit trail (A.8.15)