mosh - Mobile Shell ====================== .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **What is Mosh?** Mosh (Mobile Shell) is a remote terminal application similar to SSH but designed to work better in mobile and unstable network environments. It supports roaming, intermittent connectivity, and intelligent local echo and line editing. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Why is Mosh useful?** * Maintains session even if the IP address changes (e.g., switching networks). * Automatically reconnects after temporary network loss. * Reduces perceived latency through local echo. * More responsive than SSH on high-latency connections. * Ideal for users working remotely or on mobile networks. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **How it works?** * Mosh starts by using SSH to authenticate and establish an initial session. * It then starts a `mosh-server` on the remote machine and connects using a custom UDP-based protocol. * The client and server communicate over UDP, enabling session continuity even with network changes. * Mosh predicts user input locally and updates when the server responds, providing fast feedback. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Where is Mosh used?** * Remote system administration over unstable or mobile networks. * Developers and sysadmins working over Wi-Fi, cellular, or satellite links. * Any situation where SSH performance is affected by latency or roaming. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which OSI layer does this protocol belong to?** * Mosh operates primarily at the **Application Layer (Layer 7)**. * It uses **UDP** at the Transport Layer but implements its own reliability and state tracking. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **IS Mosh Windows specific?** * No, Mosh is not Windows-specific. * While originally built for Unix-like systems, Mosh clients can be used on Windows via WSL, Cygwin, or compatible ports. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **IS Mosh Linux Specific?** * No, Mosh is not Linux-specific, though it's primarily used on Linux, macOS, and BSD. * The server side is usually installed on Unix-like systems, but clients can run on multiple platforms. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which Transport Protocol is used by Mosh?** * Mosh uses **UDP** for all communication after the initial SSH connection. * It implements its own protocol on top of UDP for reliability and encryption. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Which Port is used by Mosh?** * Mosh uses **UDP ports in the range 60000–61000** by default. * The actual port is chosen randomly and communicated during the SSH handshake. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow **Is Mosh using Client server model?** * Yes, Mosh uses the **client-server model**. * The **client** initiates a session via SSH, then switches to a UDP-based connection with the **mosh-server** running on the remote system. .. panels:: :container: container pb-4 :column: col-lg-12 p-2 :card: shadow Topics in this section, * :ref:`Learnings in this section ` * :ref:`Terminology ` * :ref:`Version Info ` * :ref:`mosh Version&IEEE Details ` * :ref:`mosh Basic Setup on Ubuntu using IPv4 ` * :ref:`mosh Basic Setup on Ubuntu using IPv6 ` * :ref:`mosh Protocol Packet Details ` * :ref:`mosh Usecases ` * :ref:`mosh Basic Features ` * :ref:`Reference links ` .. _mosh_step1: .. tab-set:: .. tab-item:: Learnings in this section * In this section, you are going to learn .. _mosh_step2: .. tab-set:: .. tab-item:: Terminology * Terminology .. _mosh_step3: .. tab-set:: .. tab-item:: Version Info * Version Info .. _mosh_step5: .. tab-set:: .. tab-item:: mosh Version&RFC Details * rfc details .. _mosh_step18: .. tab-set:: .. tab-item:: mosh Basic Setup on Ubuntu using IPv4 * setup .. _mosh_step19: .. tab-set:: .. tab-item:: mosh Basic Setup on Ubuntu using IPv6 * setup .. _mosh_step6: .. tab-set:: .. tab-item:: mosh Protocol Packet Details * packet details .. _mosh_step7: .. tab-set:: .. tab-item:: mosh Usecases * usecases .. _mosh_step8: .. tab-set:: .. tab-item:: mosh Basic Features * features .. _mosh_step17: .. tab-set:: .. tab-item:: Reference links * Reference links