|
1 |
| -Mosh: the mobile shell |
2 |
| -====================== |
3 |
| - |
4 |
| -Mosh is a remote terminal application that supports intermittent |
5 |
| -connectivity, allows roaming, and provides speculative local echo |
6 |
| -and line editing of user keystrokes. |
7 |
| - |
8 |
| -It aims to support the typical interactive uses of SSH, plus: |
9 |
| - |
10 |
| - * Mosh keeps the session alive if the client goes to sleep and |
11 |
| - wakes up later, or temporarily loses its Internet connection. |
12 |
| - |
13 |
| - * Mosh allows the client and server to "roam" and change IP |
14 |
| - addresses, while keeping the connection alive. Unlike SSH, Mosh |
15 |
| - can be used while switching between Wi-Fi networks or from Wi-Fi |
16 |
| - to cellular data to wired Ethernet. |
17 |
| - |
18 |
| - * The Mosh client runs a predictive model of the server's behavior |
19 |
| - in the background and tries to guess intelligently how each |
20 |
| - keystroke will affect the screen state. When it is confident in |
21 |
| - its predictions, it will show them to the user while waiting for |
22 |
| - confirmation from the server. Most typing and uses of the left- |
23 |
| - and right-arrow keys can be echoed immediately. |
24 |
| - |
25 |
| - As a result, Mosh is usable on high-latency links, e.g. on a |
26 |
| - cellular data connection or spotty Wi-Fi. In distinction from |
27 |
| - previous attempts at local echo modes in other protocols, Mosh |
28 |
| - works properly with full-screen applications such as emacs, vi, |
29 |
| - alpine, and irssi, and automatically recovers from occasional |
30 |
| - prediction errors within an RTT. On high-latency links, Mosh |
31 |
| - underlines its predictions while they are outstanding and removes |
32 |
| - the underline when they are confirmed by the server. |
33 |
| - |
34 |
| -Mosh does not support X forwarding or the non-interactive uses of SSH, |
35 |
| -including port forwarding. |
36 |
| - |
37 |
| -Other features |
38 |
| --------------- |
39 |
| - |
40 |
| - * Mosh adjusts its frame rate so as not to fill up network queues |
41 |
| - on slow links, so "Control-C" always works within an RTT to halt |
42 |
| - a runaway process. |
43 |
| - |
44 |
| - * Mosh warns the user when it has not heard from the server |
45 |
| - in a while. |
46 |
| - |
47 |
| - * Mosh supports lossy links that lose a significant fraction |
48 |
| - of their packets. |
49 |
| - |
50 |
| - * Mosh handles some Unicode edge cases better than SSH and existing |
51 |
| - terminal emulators by themselves, but requires a UTF-8 |
52 |
| - environment to run. |
53 |
| - |
54 |
| - * Mosh leverages SSH to set up the connection and authenticate |
55 |
| - users. Mosh does not contain any privileged (root) code. |
56 |
| - |
57 |
| -Getting Mosh |
58 |
| ------------- |
59 |
| - |
60 |
| - [The Mosh web site](http://mosh.mit.edu/#getting) has information about |
61 |
| - packages for many operating systems, as well as instructions for building |
62 |
| - from source. |
63 |
| - |
64 |
| - Note that `mosh-client` receives an AES session key as an environment |
65 |
| - variable. If you are porting Mosh to a new operating system, please make |
66 |
| - sure that a running process's environment variables are not readable by other |
67 |
| - users. We have confirmed that this is the case on GNU/Linux, OS X, and |
68 |
| - FreeBSD. |
69 |
| - |
70 |
| -Usage |
71 |
| ------ |
72 |
| - |
73 |
| - The `mosh-client` binary must exist on the user's machine, and the |
74 |
| - `mosh-server` binary on the remote host. |
75 |
| - |
76 |
| - The user runs: |
77 |
| - |
78 |
| - $ mosh [user@]host |
79 |
| - |
80 |
| - If the `mosh-client` or `mosh-server` binaries live outside the user's |
81 |
| - `$PATH`, `mosh` accepts the arguments `--client=PATH` and `--server=PATH` to |
82 |
| - select alternate locations. More options are documented in the mosh(1) manual |
83 |
| - page. |
84 |
| - |
85 |
| - There are [more examples](http://mosh.mit.edu/#usage) and a |
86 |
| - [FAQ](http://mosh.mit.edu/#faq) on the Mosh web site. |
87 |
| - |
88 |
| -How it works |
89 |
| ------------- |
90 |
| - |
91 |
| - The `mosh` program will SSH to `user@host` to establish the connection. |
92 |
| - SSH may prompt the user for a password or use public-key |
93 |
| - authentication to log in. |
94 |
| - |
95 |
| - From this point, `mosh` runs the `mosh-server` process (as the user) |
96 |
| - on the server machine. The server process listens on a high UDP port |
97 |
| - and sends its port number and an AES-128 secret key back to the |
98 |
| - client over SSH. The SSH connection is then shut down and the |
99 |
| - terminal session begins over UDP. |
100 |
| - |
101 |
| - If the client changes IP addresses, the server will begin sending |
102 |
| - to the client on the new IP address within a few seconds. |
103 |
| - |
104 |
| - To function, Mosh requires UDP datagrams to be passed between client |
105 |
| - and server. By default, `mosh` uses a port number between 60000 and |
106 |
| - 61000, but the user can select a particular port with the -p option. |
107 |
| - |
108 |
| -Advice to distributors |
109 |
| ----------------------- |
110 |
| - |
111 |
| -A note on compiler flags: Mosh is security-sensitive code. When making |
112 |
| -automated builds for a binary package, we recommend passing the option |
113 |
| -`--enable-compile-warnings=error` to `./configure`. On GNU/Linux with |
114 |
| -`g++` or `clang++`, the package should compile cleanly with |
115 |
| -`-Werror`. Please report a bug if it doesn't. |
116 |
| - |
117 |
| -Where available, Mosh builds with a variety of binary hardening flags |
118 |
| -such as `-fstack-protector-all`, `-D_FORTIFY_SOURCE=2`, etc. These |
119 |
| -provide proactive security against the possibility of a memory |
120 |
| -corruption bug in Mosh or one of the libraries it uses. For a full |
121 |
| -list of flags, search for `HARDEN` in `configure.ac`. The `configure` |
122 |
| -script detects which flags are supported by your compiler, and enables |
123 |
| -them automatically. To disable this detection, pass |
124 |
| -`--disable-hardening` to `./configure`. Please report a bug if you |
125 |
| -have trouble with the default settings; we would like as many users as |
126 |
| -possible to be running a configuration as secure as possible. |
127 |
| - |
128 |
| -Mosh ships with a default optimization setting of `-O2`. Some |
129 |
| -distributors have asked about changing this to `-Os` (which causes a |
130 |
| -compiler to prefer space optimizations to time optimizations). We have |
131 |
| -benchmarked with the included `src/examples/benchmark` program to test |
132 |
| -this. The results are that `-O2` is 40% faster than `-Os` with g++ 4.6 |
133 |
| -on GNU/Linux, and 16% faster than `-Os` with clang++ 3.1 on Mac OS |
134 |
| -X. In both cases, `-Os` did produce a smaller binary (by up to 40%, |
135 |
| -saving almost 200 kilobytes on disk). While Mosh is not especially CPU |
136 |
| -intensive and mostly sits idle when the user is not typing, we think |
137 |
| -the results suggest that `-O2` (the default) is preferable. |
138 |
| - |
139 |
| -More info |
140 |
| ---------- |
141 |
| - |
142 |
| - * Mosh Web site: |
143 |
| - |
144 |
| - <http://mosh.mit.edu> |
145 |
| - |
146 |
| - * `[email protected]` mailing list: |
147 |
| - |
148 |
| - <http://mailman.mit.edu/mailman/listinfo/mosh-devel> |
149 |
| - |
150 |
| - * `[email protected]` mailing list: |
151 |
| - |
152 |
| - <http://mailman.mit.edu/mailman/listinfo/mosh-users> |
153 |
| - |
154 |
| - * `#mosh` channel on [Freenode IRC](http://freenode.net/) |
155 |
| - |
156 |
| - http://webchat.freenode.net/?channels=mosh |
| 1 | +Alfalfa is a research project to build a videoconferencing system |
| 2 | +that works well over cellular wireless networks. It uses the same |
| 3 | +SSP protocol as Mosh, the mobile shell. |
0 commit comments