This review dives into Mosh Security from a technical and performance standpoint. Mosh began as a secure replacement for SSH, designed to keep remote sessions alive across network changes and interruptions. Security in Mosh is built on modern cryptographic methods. It uses AES-128 in OCB mode for authenticated encryption, with keys established via ECDH over Curve25519. This combination gives confidentiality and integrity without sacrificing speed.
Unlike SSH, Mosh does not transmit every keystroke immediately. It uses predictive local echo, sending keystrokes in batches over UDP. While this optimizes latency, it puts more weight on encryption and authentication to defend against replay and packet spoofing. The Mosh Security model rests on the assumption that if an attacker cannot forge authenticated packets, they cannot hijack the session. The implementation uses per-message nonces to prevent reuse, ensuring packet integrity.
From a network exposure perspective, Mosh does not listen on a TCP port. It opens a UDP port with a randomized high-number assignment. This reduces passive scanning risk but does not remove the need for strong firewall rules. Key exchange happens over an initial SSH handshake, so SSH’s own security profile directly impacts Mosh’s first link in the chain. If SSH is misconfigured or compromised, your Mosh session inherits that weakness.