ci Mosh: the mobile shell Mosh is a remote terminal application that supports…
- User
User: ci Mosh: the mobile shell Mosh is a remote terminal application that supports intermittent connectivity, allows roaming, and provides speculative local echo and line editing of user keystrokes.
It aims to support the typical interactive uses of SSH, plus:
Mosh keeps the session alive if the client goes to sleep and wakes up later, or temporarily loses its Internet connection.
Mosh allows the client and server to "roam" and change IP addresses, while keeping the connection alive. Unlike SSH, Mosh can be used while switching between Wi-Fi networks or from Wi-Fi to cellular data to wired Ethernet.
The Mosh client runs a predictive model of the server's behavior in the background and tries to guess intelligently how each keystroke will affect the screen state. When it is confident in its predictions, it will show them to the user while waiting for confirmation from the server. Most typing and uses of the left- and right-arrow keys can be echoed immediately.
As a result, Mosh is usable on high-latency links, e.g. on a cellular data connection or spotty Wi-Fi. In distinction from previous attempts at local echo modes in other protocols, Mosh works properly with full-screen applications such as emacs, vi, alpine, and irssi, and automatically recovers from occasional prediction errors within an RTT. On high-latency links, Mosh underlines its predictions while they are outstanding and removes the underline when they are confirmed by the server.
Mosh does not support X forwarding or the non-interactive uses of SSH, including port forwarding.
Other features Mosh adjusts its frame rate so as not to fill up network queues on slow links, so "Control-C" always works within an RTT to halt a runaway process.
Mosh warns the user when it has not heard from the server in a while.
Mosh supports lossy links that lose a significant fraction of their packets.
Mosh handles some Unicode edge cases better than SSH and existing terminal emulators by themselves, but requires a UTF-8 environment to run.
Mosh leverages SSH to set up the connection and authenticate users. Mosh does not contain any privileged (root) code.
Getting Mosh The Mosh web site has information about packages for many operating systems, as well as instructions for building from source.
Note that mosh-client receives an AES session key as an environment variable. If you are porting Mosh to a new operating system, please make sure that a running process's environment variables are not readable by other users. We have confirmed that this is the case on GNU/Linux, OS X, and FreeBSD.
Usage The mosh-client binary must exist on the user's machine, and the mosh-server binary on the remote host.
The user runs:
PATH, mosh accepts the arguments --client=PATH and --server=PATH to select alternate locations. More options are documented in the mosh(1) manual page.
- Assistant
要安装 Mosh,您可以根据您的操作系统按照以下步骤进行:
在 Ubuntu/Debian 上:
- 打开终端。
- 更新软件包列表:
sudo apt update - 安装 Mosh:
sudo apt install mosh
在 CentOS/RHEL 上:
- 打开终端。
- 确保 EPEL 仓库已启用(如果未启用):
sudo yum install epel-release - 安装 Mosh:
sudo yum install mosh
在 macOS 上:
- 使用 Homebrew(如果未安装 Homebrew,请先到https://brew.sh/安装):
brew install mosh
在 Windows 上:
Mosh 没有原生的 Windows 客户端,但您可以使用 Windows Subsystem for Linux (WSL) 在 Windows 上运行 Linux 版本的 Mosh。
- 设置 WSL,并安装 Ubuntu 或其他 Linux 发行版。
- 在 WSL 的终端中,按照 Ubuntu 的安装步骤进行安装。
从源代码编译:
- 首先确保安装了必要的开发工具和库。
- 从 Mosh 的官方网站或 GitHub 仓库获取源码。
- 解压缩并进入源码目录。
- 运行以下命令以编译和安装:
./configure make sudo make install
总之,Mosh 支持多种操作系统,而且通过包管理器进行安装通常是最简单的方式。如果需要更多的安装信息,可以访问 查看详细的安装指导。