3 ms·
Don't fall into the trap of thinking that mosh is based upon SSH, that mosh is just another SSH client. mosh is not "mosh special" SSH in place of "normal" SSH
by JdeBP 10y ago
Don't fall into the trap of thinking that mosh is based upon SSH, that mosh is just another SSH client. mosh is not "mosh special" SSH in place of "normal" SSH. The actual main run-time operation of mosh does not involve SSH at all.
It is not even architecturally the same as SSH. mosh runs an internal terminal emulator on the server machine. SSH employs an external terminal emulator on the client machine. The terminal emulator on the server machine is the mosh-server program, which is necessary for this architecture to work. If there is no server-side program installed, part of the overall system is missing, for which SSH is not a substitute.
mosh uses SSH, but merely at client startup, as a means of remotely executing the server command that it speaks to and exchanging a shared secret with it. In theory, it could even be changed to use something other than SSH for that, without changing the primary operation of the mosh client and server. (Parsing the output of a shell, including the output of whatever non-interactive startup scripts that shell may run, for a magic sequence is a somewhat rickety mechanism; reminiscent of Fidonet handshakes and Zmodem, but not done as well as they.)